Jump to content
  • Advertisement
Sign in to follow this  
ajithk

Setting constant buffer 'asynchronously'

This topic is 866 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

Hi everyone,

I have a constant buffer which is bound to b3 register. But none of the shaders currently bound to pipeline have got any constant buffers bound to b3. Can I use UpdateSubresource now to update my constant buffer and will it reflect in any subsequent shader I use in which a binding point to b3 exists?

Share this post


Link to post
Share on other sites
Advertisement

As I understand it, when you update the contents of a resource, the GPU memory buffer is updated.. When you bind a resource to a shader, you merely tell the shader where to read from. So yes, I would say it would work like expected, merely guessing though :)

 

Easiest way is to just test it :D

Share this post


Link to post
Share on other sites
The runtime/driver will synchronize UpdateResource for you. This means that use a constant buffer for draw call A, update the constant buffer, and then issue draw call B, it will appear as though the buffer were update in between A and B.

Share this post


Link to post
Share on other sites
@vinterberg and @MJP

I have tested it and what you said is correct. Btw, just for the sake of curiosity, I had a look at Vulkan/Direct3D 12 to figure out how driver does these things. Didn't understand a thing :D Waiting for those awesome authors out there to release a book.

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!