Sign in to follow this  
cozzie

Why use 'SetVertexShader'?

Recommended Posts

Hi,

Maybe a stupid question, but why should I use d3ddev->SetVertexShader of SetPixelShader?

 

I use D3DXEffect and a VertexDeclaration I set with d3ddev->SetVertexDeclaration. Everything works nicely and I don't use SetVertexShader or SetPixelShader.

 

I'm only using effects/shaders, no fixed pipeline support.

Share this post


Link to post
Share on other sites

If you're using Effects you don't need to, but you don't have to use Effects.

 

Remember - the Effects framework is just a wrapper around the D3D9 API; it's nothing more, it doesn't talk to either the hardware or the driver on it's own, all it is is just a software wrapper.  So the option to not use Effects is always there, and that's when you'd use SetVertexShader and SetPixelShader.

Share this post


Link to post
Share on other sites

Thanks.

I'd think then that the D3DXEffect functions to set a technique or begin a technique/pass would do the 'SetVertexShader' calls then in the background. Strange thing is that I don't see this back when profiling in PIX (no SetVertexShader at all in rendering a frame, just a settechnique). 

Share this post


Link to post
Share on other sites

Depending on the capture type you've selected, you'll have a "Capture D3DX calls also" checkbox - check that and you'll see them.  Only the BeginPass and CommitChanges calls should be expandable, as they're where Set*Shader calls are made and constant registers are set; everything else is just the software layer that doesn't call into D3D but merely buffers up stuff until either BeginPass or CommitChanges are called.

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