Closed GoogleCodeExporter closed 9 years ago
EXAMPLE ABOVE - DID NOT EDIT EXAMPLE CORRECTLY - FOLLOWING CODE SHOWS FAILURE
using SlimDX;
using SlimDX.Direct3D10;
using SlimDX.DXGI;
using SlimDX.D3DCompiler;
// LOAD THE TEXTURES
Texture2D texture2D1 = Texture2D.FromFile("texture1.png");
Texture2D texture2D2 = Texture2D.FromFile("texture2.png");
// CREATE THE ARRAY
ShaderResourceView[] v = new ShaderResourceView[2];
v[0] = new ShaderResourceView(device,texture2D1);
v[1] = new ShaderResourceView(device,texture2D2);
// THE FOLLOWING TWO LINES FAIL
// effectTextureVariable.AsResource().SetResourceArray(v);
// effectTextureVariable.AsResource().SetResourceArray(v,0,2);
// THE FOLLOWING LINE SUCCEEDS (Setting just one item in the array)
effectTextureVariable.AsResource().SetResourceArray(v,0,1);
-------------------------------------------------------------------------------
// SHADER INPUT
Texture2DArray<float4> textureArray;
Thanks for your help.
-dana
Original comment by danaball...@gmail.com
on 15 Nov 2011 at 5:09
Texture2DArray is a single texture that has an array inside of it. The
SetResourceArray function is called for actual arrays, like this:
// hlsl
Texture2D textureArray[2];
Direct3D will crash if you try to set an array on a non-array type. There's not
much we can do about that.
Original comment by Mike.Popoloski
on 15 Nov 2011 at 6:55
Original issue reported on code.google.com by
danaball...@gmail.com
on 15 Nov 2011 at 5:07