I'm starting to use constant buffers in my program , and I get troubles to retreive correctly a matrix from a constant buffer in the shader :
Here's the constant buffer declaration in the shader :
cbuffer everyFrame
{
float3 g_vCameraPosition;
matrix g_mViewProjection;
};
Here's the corresponding structure in the program :
#define ALIGN_CONSTANT_BUFFER _declspec(align(16))
ALIGN_CONSTANT_BUFFER struct CBeveryFrame
{
D3DXVECTOR3 g_vCameraPosition;
D3DXMATRIX g_mViewProjection;
};
At the beginning of the render loop, I instanciate this structure and send it to the GPU via UpdateSubresource().
The camera position is well updated, but not the viewProj matrix : the rendering using it (geometry instancing) seems to be not done.
I looked in the DX tutorials but I can't figure out what is wrong.
Any idea ?
Thank you in advance !
Bye