• Advertisement
Sign in to follow this  

Another state changes question

This topic is 4404 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 read the faq about state changes but there is one thing I'm not really sure about. If I render multiple objects using the same shaders, textures and geometry but with different shader constants. Does it really make a difference if I update one shader constant or several at the same time? For instance: Method a: 1. Render object A 2. update several constant registers of the vertex and pixel shader 3. Reder object A again Method b: 1. Render object A 2. update less constant registers of the vertex and pixel shader 3. Render object A again Does method a really differ significantly in speed from method b? I though that the thing that hurts performance is that different parts of the pipeline get stalled. But with this case the same parts would be stalled. Thanks for giving me some insight :-) Markus

Share this post


Link to post
Share on other sites
Advertisement
State changes become an issue when the application becomes CPU bound, as you are making more api calls to change states and more draw calls due to more batches.

That being said, there is an api function in DX to create a 'parameter block' and set all parameters at once for an effect instead of individual SetXXX calls. I saw no performance change by implementing this and switching back and forth - because I am not even close to being CPU bound. So it really depends on your system specs and what you are trying to render and the loading balance of the CPU/GPU.

Share this post


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

  • Advertisement