Redundant Render States
I am using DirectX 11 and have implemented sorting by material and shader programs on my "render items." I tested the sorting visually in PIX and it is working correctly. However, right now in my engine I am not writing code to avoid redundant render states. So for example, let's say I am drawing trees and the leaves use a two sided rasterization state. Based on my sorting, all the leaves from all the trees will be drawn as a group. But for each leaf render item, it is setting the two sided rasterization state (even though it only needs to set it when it changes). I know it is simple to write code to handle this but I am wondering if the driver already does this, and if there is a way to verify the driver is doing this? Will parallel nsight show this?
The driver probably removes redundant states (I wouldn't count on it), but by that you would give the driver work, you could avoid.
I prefer wrapping the draw calls and keep track of the render state in for instance a singleton and do the state setup in my wrapped draw call.
I prefer wrapping the draw calls and keep track of the render state in for instance a singleton and do the state setup in my wrapped draw call.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement