Jump to content
  • Advertisement
Sign in to follow this  
Aqua Costa

State changes

This topic is 2503 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,

Is there any difference in performance by calling a state change like IASetVertexBuffers() do some work on CPU then call IASetIndexBuffer() (like mixing DX state calls and other CPU work) or batching all state changing commands and sending them one right after another? I guess that If the command list is empty the GPU will be idle when it could be doing some work...

Share this post


Link to post
Share on other sites
Advertisement
The GPU won't start doing work until you do a drawcall or a compute shader dispatch; everything else push data into a command queue on the CPU side.

By batching up all the state change information together and doing it in one go you can gain both data and instruction cache performance increases which can help performance; also it simply makes your code easier to understand and follow.

Basically you want to be setting up all your rendering information in advance and then blasting through the buffer in one go to set states and issue draw calls.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!