Jump to content
  • Advertisement
Sign in to follow this  
Quat

Redundant Render States

This topic is 2594 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

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

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!