I have the following C/C++ struct:
struct ShadowMapCB {
Math::Matrix4 cropMatrix[4];
Math::Matrix4 textureMatrix[4];
float splitPlane[4];
};
and my HLSL constant buffer:
cbuffer CBShadowMap : register(b4)
{
matrix g_CropMatrix[4];
matrix g_TextureMatrix[4];
float g_fSplitPlane[4];
};
When i bind it to pixel shader i get an error:
D3D11: WARNING: ID3D11DeviceContext::DrawIndexed: The size of the Constant Buffer at slot 4 of the Pixel Shader unit is too small (528 bytes provided, 576 bytes, at least, expected). This is OK, as out-of-bounds reads are defined to return 0. It is also possible the developer knows the missing data will not be used anyway. This is only a problem if the developer actually intended to bind a sufficiently large Constant Buffer for what the shader expects. [ EXECUTION WARNING #351: DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL ]
and infact the last 4 floats (array[4]) are messed up, the weird thing is that on the VS and GS it works fine..., and yes i did bind them with PSSetConstantBuffers and update it ofcourse.
What could be causing this?