Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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 = 
    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.");
}

Community Additions

ADD
Show:
© 2015 Microsoft