How To: Check for Shader Model 2.0 Support

This example demonstrates how to determine if a graphics card supports Shader Model 2.0.

To check for Shader Model 2.0 support

  1. Find the capabilities of the game's graphics device by using the GraphicsDevice.GraphicsDeviceCapabilities Property.
  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, a message is written to the output window when the game is run 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.");

Community Additions