Branch based on platform or graphics API
Branch based on platform features

Branch based on shader model

SHADER_TARGET is defined to a numeric value that matches the ShaderA program that runs on the GPU. More info
See in Glossary
target compilation model (that is, matching #pragma target directive). For example, SHADER_TARGET is 30 when compiling into Shader model 3.0. You can use it in Shader code to do conditional checks. For example:

#if SHADER_TARGET < 30 // less than Shader model 3.0: // very limited Shader capabilities, do some approximation #else // decent capabilities, do a better thing #endif

Additional resources


Did you find this page useful? Please give it a rating:

  • Branch based on platform or graphics API
    Branch based on platform features