Why use 'SetVertexShader'?

Started by
3 comments, last by cozzie 11 years, 3 months ago

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.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Advertisement

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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

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).

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks, got it. This really helps in profiling.

No surprises though, luckily

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement