Jump to content
  • Advertisement
Sign in to follow this  
n3Xus

[DX10]Unable to update constant buffer

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I can't seem to update the constant buffer no matter what I do. When I create the buffer (with the D3D10_BIND_CONSTANT_BUFFER flag) I set the initial data and that data is set correctly, but I can't get new data to the shader later on with this buffer. I tried Device10::UpdateSubresource and buffer::Map/Unmap.
device->UpdateSubresource(reinterpret_cast<ID3D10Resource*>(this->bufCbOmni),0,NULL,this->cbOmni,0,0);	
omni->fxCbOmni->SetConstantBuffer(this->bufCbOmni);

Are there any examples of this in the SDK or somewhere on the else?

Share this post


Link to post
Share on other sites
Advertisement
I fixed it using a temporarybuffer and using the ID3D10EffectConstantBuffer::GetConstantBuffer

ID3D10Buffer* tb=NULL;
omni->fxCbOmni->GetConstantBuffer(&tb);
this->cbOmni[omni->lightDataIndex]=omni->CONSTANT_BUFFER_LIGHT_OMNI;
device->UpdateSubresource(reinterpret_cast<ID3D10Resource*>(tb),0,NULL,this->cbOmni,0,0);
omni->fxCbOmni->SetConstantBuffer(tb);




Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!