Jump to content

  • Log In with Google      Sign In   
  • Create Account


Stupid question or big performance gain?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 cozzie   Members   -  Reputation: 1554

Like
0Likes
Like

Posted 08 January 2013 - 02:35 PM

Just thought of something.
Say my shader sets some renderstates or sampler states, say texture filtering technique or alphablend setting. At runtime, will these states be set again and again for each processed vertex/pixel?

If so, wouldn't it be a great performance gain to set it on the device in my code (setrenderstate) once? assuming all upcoming draw calls in the shader use them.

(i also use the d3dxdonotsavestate flag in beginning my effects/ shaders)

Sponsor:

#2 Tom KQT   Members   -  Reputation: 1542

Like
0Likes
Like

Posted 08 January 2013 - 04:27 PM

You mean the effect framework, right? It simply sets the render or sampler state the same way you would (device->SetRenderState etc.), there's no magic behind it. It definitely doesn't set it per vertex/pixel ;)
You can do some optimizations if you do it manually (for example don't set a state to the same value it already has), but that's not directly related to your question, and the performance gain may be very small (if any).

Edited by Tom KQT, 08 January 2013 - 04:29 PM.


#3 cozzie   Members   -  Reputation: 1554

Like
0Likes
Like

Posted 08 January 2013 - 05:00 PM

Thanks, good to know.

And if were so, my FPS would probably be not as good as it is now (when I think of it again :))






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS