# define constants in registers

This topic is 5145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi! Can anyone help me and explan me why these line of codes give me an error in runtime execution ? hr |= this->direct3DDevice->BeginScene(); D3DXMATRIX compMat; D3DXMatrixMultiply( &mat, &mat, &m_matView); D3DXMatrixMultiply( &mat, &mat, &m_matProj); hr |= m_pVConstantTable->SetMatrix(this->direct3DDevice, "WorldViewProj", &mat); The error is setting the matrix, and is : Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. I will also ask you different methods to link variables defined in my vertex and pixel texture,as float2, float4x4 or textures with my matprojworld, or texture variables in my application code ?? Hope someone can help me! Thanks, Jesus

##### Share on other sites
Quote:
 Original post by yurixd hr |= this->direct3DDevice->BeginScene(); D3DXMATRIX compMat; D3DXMatrixMultiply( &mat, &mat, &m_matView); D3DXMatrixMultiply( &mat, &mat, &m_matProj); hr |= m_pVConstantTable->SetMatrix(this->direct3DDevice, "WorldViewProj", &mat);The error is setting the matrix, and is : Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

##### Share on other sites
Yes I know, but how can i solve it?

##### Share on other sites
As JohnBolton said, this is a pointer problem, not really a DirectX problem. You need to make sure that the constant table pointer is valid.

When you compile your shader, make sure that no errors are returned and that the constant table pointer is valid. Check the debug spew to see if there were any errors while compiling the shader.

neneboricua

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 30
• 9
• 16
• 22