Export (0) Print
Expand All
1 out of 7 rated this helpful - Rate this topic

How To: Check for Shader Model 2.0 Support

Demonstrates how to find out whether a graphics card supports Shader Model 2.0.

Checking for Shader Model 2.0 Support

To check for Shader Model 2.0 support

  1. Use the GraphicsDevice.GraphicsDeviceCapabilities Property to find the capabilities of the game's graphics device.

  2. Compare GraphicsDeviceCapabilities.MaxPixelShaderProfile to the member of the ShaderProfile enumeration that represents pixel shader version ps_2_0.

    In this example, if the graphics device does not support this shader model, the output window displays a message when you run the game in debug mode.

// Check the graphics device used by the game for the necessary shader support.
GraphicsDeviceCapabilities caps = graphics.GraphicsDevice.GraphicsDeviceCapabilities;
if (caps.MaxPixelShaderProfile < ShaderProfile.PS_2_0)
    // This device does not support Shader Model 2.0.
    System.Diagnostics.Debug.WriteLine("This adapter does not support Shader Model 2.0.");
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.