Archived

This topic is now archived and is closed to further replies.

quasar3d

RenderStates

Recommended Posts

I know things like SetRenderState, SetTexture etc. are slow. But if you by example set the same texture that''s already set, does this also cost that much performance, or does d3d know it''s already set, and so it doesn''t set it again? So, will it be a good idea to save all my states in an array, and then when I need to set a state, I firstcheck if the state isn''t already set to the right value? Or am I doing something d3d is already doing this way? My Site

Share this post


Link to post
Share on other sites
They are not slow, but changing states affect more than just that particular state. As Richard Huddy(ex nVidia) told me once:
-Changing states turns a lot of "knobs" inside the hardware and it goes without saying that doing that too often is not very efficient. Basically, you need to plan ahead so you try to minimize state changing as much as it is possible. Not that you should avoid it.

____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

Share this post


Link to post
Share on other sites
That''s a very small gain and hardly worth the inconvenience it causes.

____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

Share this post


Link to post
Share on other sites
Since no one has said it, DirectX does not know about redundant SetTexture calls. Be careful with them .

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Since no one has said it, DirectX does not know about redundant SetTexture calls.

Pardon for asking but how do you know?

Share this post


Link to post
Share on other sites