RenderStates

Started by
5 comments, last by quasar3d 20 years, 8 months ago
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
Advertisement
bang

My Site
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.

No no no no! :)
If you''re using a non-pure device, then Direct3D will check for redundant state changes and attempt to prevent them. If you''re using a pure device, however, you won''t get this option but in return you''ll gain performance.

---
Brent Gunning | My Site | Article Thoughts: "On Batching"
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.

No no no no! :)
Since no one has said it, DirectX does not know about redundant SetTexture calls. Be careful with them .
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
quote:Since no one has said it, DirectX does not know about redundant SetTexture calls.

Pardon for asking but how do you know?

This topic is closed to new replies.

Advertisement