IfAttribute
Description
- Derived from
-
Attribute abstract
Indicates that the annotated method or field shall be included in the source code for compilation only if the given preprocessor symbol is defined / not defined.
Public / Constructors
IfAttribute
Creates a new instance of If.
The following default preprocessor symbols are defined by the Gpu-X code generator, depending on the enclosing shader:
-
GX_SHADER_CS
: when inside a compute shader, see ComputeShader. -
GX_SHADER_GS
: when inside a compute shader, see GeometryShader. -
GX_SHADER_PS
: when inside a pixel shader, see PixelShader. -
GX_SHADER_TP
: when inside a tessellate patch shader, see TessellatePatchShader. -
GX_SHADER_TV
: when inside a tessellate vertex shader, see TessellateVertexShader. -
GX_SHADER_VS
: when inside a vertex shader, see VertexShader.
The programming language and target identifier are encoded as the following preprocessor symbols, for example:
-
GX_HLSL_DX9
: using HLSL with Direct3D 9 -
GX_HLSL_DX11
: using HLSL with Direct3D 11 -
GX_HLSL_DX12
: using HLSL with Direct3D 12 -
GX_GLSL_GL41
: using GLSL with OpenGL 4.1 or newer -
GX_GLSL_GLES30
: using GLSL with OpenGLES 3.0 or newer