VSSet, GSSet, PSSet

Started by
0 comments, last by MJP 13 years, 3 months ago
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?
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.

This topic is closed to new replies.

Advertisement