Sign in to follow this  
Jace-

Speed question when setting the Vertex Shader

Recommended Posts

MSDN documentation doesnt give any information (or i couldnt find it...) on what happens when you call IDirect3DDevice9::SetVertexShader() twice using the same shader ie: IDirect3DVertexShader9* sameShader; ... Device->SetVertexShader( sameShader ); Device->SetVertexShader( sameShader ); Would this result in a no-op? or does it blindly set the current enabled shader again? More practically, I'm worried about different objects in a scene that share the same shader calling SetVertexShader() before they render; resulting in the same operation happening needlessly. Thanks,

Share this post


Link to post
Share on other sites
For Hardware, Mixed, and Software devices, it will ignore it (and it will warn you about it in debug mode, if your debug level is high enough).

A pure device will go ahead and set it again with the driver, which can affect performance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this