Crossbones+ - Reputation: 3540
Posted 01 February 2012 - 04:21 AM
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...
Members - Reputation: 10563
Posted 01 February 2012 - 06:30 AM
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.