Jump to content
  • Advertisement
Sign in to follow this  
maya18222

VSSet, GSSet, PSSet

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

How often do calls such as

[source]
m_pD3DDevice->VSSetConstantBuffers( 0, NUMBUFFERS, m_pCBuffers );
m_pD3DDevice->GSSetConstantBuffers( 0, NUMBUFFERS, m_pCBuffers );
m_pD3DDevice->PSSetConstantBuffers( 0, NUMBUFFERS, m_pCBuffers );
[/source]

need to be made?

If all my shaders use the same CBuffers, can I just make the above call once? Say at the start of each frame, or do I need to call it every time I change a shader such as "VSSetShader" ?

Same goes for "PSSetSamplers", "PSSetShaderResources", "VSSetShaderResources". IF the textures and samplers didnt change between me switching shaders, do I still need to set them again when changing shader?

Share this post


Link to post
Share on other sites
Advertisement
The state persists on the device, even if you change shaders. You only need to set them again when you want to set different constant buffers.

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!