Archived

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

Calling things like SetRenderState etc to many times a waste of frame rate?

This topic is 5042 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''m wondering if calling things like SetRenderState, SetMaterial or SetTexture too many times, like say I call one of each for each item drawn would that slow my frame rate down alot, so should i just group the objects to be drawn in such a way so i only call the set whatever once. Thanks,

Share this post


Link to post
Share on other sites
Not as such. It will likely stall the device, not to mention that pure devices do not support Get* calls.

"... This method will not return device state for a device that is created using D3DCREATE_PUREDEVICE. If you want to use this method, you must create your device with any of the other values in D3DCREATE."

The best way is to keep track of your current renderstate yourself by recording changes, ignoring redundant changes, and sorting your rendering queue based on the most expensive state changes (textures, etc). Care must be given to where sorting would actually cause the application to run slower than if you were to change the state -- however, changing states affects different hardware in different ways. Driver execs from the companies may be able to clear up which are the worst in their cases.

Share this post


Link to post
Share on other sites