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
Usages
Example.CS method
Example.GS method
Example.PS method
Example.PS_Centroid method
Example.PS_Sample method
Example.TP method
Example.TV method
Example.VS method
Graphics.GS_Line method
Graphics.GS_Point method
Lighting.Ambient method
Lighting.AmbientOcclusion method
Lighting.Directional method
Lighting.Emissive method
Lighting.Environment method
Lighting.FakeGgx method
Lighting.Fog method
Lighting.Specular method
Lighting.ToneMap method
Lighting.Unlit method
Lighting.Warp method
Mipmap.CS_Linear method
Mipmap.CS_Srgb method
Model.GS_Line method
Model.GS_Point method
Model.PS_Sample method
Renderer.GS_Point method
Renderer.GS_Thick method
Renderer.GS_Thin method
Shadow.Compute method
Shadow.Write method
Terrain.GS_Material method
Terrain.PS_Material2 method
Terrain.TP_Material method
Terrain.TV_Material method
Terrain.VS_Material2 method
Terrain_Material.Color method
Terrain_Material.Compute1 method
Terrain_Material.Compute3 method
Terrain_Material.Finish method
Terrain_Material.GridLine method
Terrain_Material.Mix2 method
Terrain_Material.Mix3 method
Terrain_Material.Prepare method
Terrain_Material.Weight method
Terrain_Texture.Sample method
Terrain_Util.HighlightColor method
Terrain_Util.LayerBlendClip method
Terrain_Util.MaterialColor method
Triangulate.CS_SectorList method
Triangulate.CS_TriangleTerminal method