Caps.VertexShaderVersion Property (Microsoft.DirectX.Direct3D)

Retrieves a structure that indicates the main and subordinate vertex shader versions supported by a device.


Visual BasicPublic ReadOnly Property VertexShaderVersion As VersionLeave Site
C#public VersionLeave Site VertexShaderVersion { get; }
property VersionLeave Site^ VertexShaderVersion {
        VersionLeave Site^ get();
JScriptpublic function get VertexShaderVersion() : VersionLeave Site

Property Value

A VersionLeave Site object that indicates the main and subordinate vertex shader versions supported by the device.

This property is read-only. 


Only vertex shaders with version numbers equal to or less than the value indicated by this member succeed in calls to the VertexShader constructor.

How Do I...?

Check for Shader Support

This example shows how to check the hardware device for shader support.

To determine whether the hardware device supports shaders, Microsoft Direct3D allows the application to check the shader version.

To check for shader support:

  1. Obtain the device's capabilities by using the Manager.GetDeviceCaps method.
  2. Using the capabilities object obtained with the previous call, check the shader version by calling Caps.VertexShaderVersion.

public bool CheckShaderSupport()
    Version v1_1 = new Version(1,1); // check version is at least shader 1.1

    // retrieve the device caps
    Caps caps = Manager.GetDeviceCaps(0, DeviceType.Hardware);

    // check the supported shader version
    if ((caps.VertexShaderVersion >= v1_1) && (caps.PixelShaderVersion >= v1_1))
        return true;

    return false;