I'm using SharpDX (compatible with SlimDX) and trying to put arrays into a constant buffer.
I made a struct and gave it a StructLayout with LayoutKind.Explicit and I manually set Size also.
Inside the struct, I make arrays with attributes FieldOffset and MarshalAs in which I set UnmanagedType.ByValArray and I manually set SizeConst.
When I instantiate the struct, I create the arrays to the size I specified. Then I populate them with the values I want.
Then I update the constant buffer with my struct data, and the size is divisible by 16.
In the shader, I have the arrays of corresponding data types set to the sizes to match the ones in C#. It's all inside a tbuffer.
But then when I run the pixel shader, all the values it reads from the arrays seem to be 0, regardless of what values I set in it.
I know the constant buffer in general is working, because it was working before I added the arrays to the structure.
So what could be wrong?