State changes

Started by
0 comments, last by _the_phantom_ 12 years, 2 months ago
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...
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.

This topic is closed to new replies.

Advertisement