I am finding my project is starting to show performance degradation and I need to optimize it. The answer to my previous question and this presentation from NVidia have helped greatly in understanding the performance characteristics of code using the GPU but there are a couple of things that aren't clear that I need to know to optimize my drawing.
Specifically, what calls make the distinction between batches.
I know that any state changes cause a new batch, so that includes:
- Render State Changes
- Buffer Changes
- Shader Changes
- Render Target Changes
Correct? What else counts as a 'state change'?
Does each Draw**Primitive() call constitute a new batch? Even if I were to issue the same call twice, with no state changes, or call it once on on part of the buffer, then again on another?
If I were to update a buffer, but not change the bindings, would that be a new batch?
That presentation and a DX9 page suggest using all of the texture slots available, which I take to mean loading multiple objects in 'parallel' by mapping their buffers/shaders/textures to slots 1-16. But I am not sure how this works - surely to do this you would need to change the buffer binding and that would count as a state change? (or is it a case of you do but it saves 16 calls so its OK?)