Version: Unity 6 Preview (6000.0)
Language : English
Static and dynamic branching in a shader
Branch based on platform or graphics API

Branch in a shader via built-in macros

Resources for adding a condition in a shaderA program that runs on the GPU. More info
See in Glossary
based on the platform, shader model, Unity Version, or shader pass.

Page Description
Branch based on platform or graphics API Use SHADER_API macros to make shader behaviour conditional on the platform or graphics API.
Branch based on shader model Use SHADER_TARGET to make shader behaviour conditional on the shader model.
Branch based on platform features Use platform difference helpers to make shader behaviour conditional on platform functionality.
Branch based on Unity version Use UNITY_VERSION to make shader behaviour conditional on the Unity version.
Branch based on shader pass or shader stage Use SHADER_STAGE or UNITY_PASS to make shader behaviour conditional on the shader stage or shader pass.

Additional resources

Static and dynamic branching in a shader
Branch based on platform or graphics API