Jump to content
  • Advertisement
Sign in to follow this  

Detecting supported shader-models

This topic is 4774 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've been toying around with shaders, and now I want to make a full implementation. But, in order to make fallback available, I want to be able to find out wether a certain shader model is supported. Now, the only function I can find is D3DXGetPixelShaderProfile, but that one only tells me what the maximum version is. As the hardware develops, I won't just be able to say "if D3DXGetPixelShaderProfile == "ps_3_0" then ok"... So, is there a way to find out if, say "ps_2_0" is supported by my hardware? Thanks in advance Nizro

Share this post


Link to post
Share on other sites
Advertisement
1) call: IDirect3DDevice9::GetDeviceCaps or IDirect3D9::GetDeviceCaps

2) the VertexShaderVersion and PixelShaderVersion members of the D3DCAPS9 returned from GetDeviceCaps tells you the highest shader version that device is capable of.

3) Use the D3DVS_VERSION and D3DPS_VERSION macros to create a version number

4) example:

D3DCAPS9 caps;
lpd3dDevice->GetDeviceCaps(&caps);
// check whether the hardware can do pixel shader 1.4 and above
if (caps.PixelShaderVersion < D3DPS_VERSION(1,4))
{
ERROR("this application requires at least pixel shader 1.4 capable hardware");
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!