raiop.blogg.se

Hlsl shader viewer
Hlsl shader viewer









hlsl shader viewer

You can also use the #pragma target directive followed by a list of space-delimited shader keywords. To specify a shader model, use #pragma target directive. #pragma require integers mrt8 : EXAMPLE_KEYWORD In this example, the shader requires integers in all cases, and mrt8 if EXAMPLE_KEYWORD is enabled. You can use multiple #pragma require lines. This means that the requirement applies only to variants that are used when any of the given keywords are enabled.įor example: #pragma require integers mrt8 : EXAMPLE_KEYWORD OTHER_EXAMPLE_KEYWORD You can also use the #pragma require directive followed by a colon and a list of space-delimited shader keywords. For example: #pragma require integers mrt8 To specify required features, use the #pragma require directive, followed by a list of space-delimited values. Specifying GPU features or a shader model To avoid seeing this warning message, explicitly add the requirements or use an appropriate target value in your code. If the list of requirements (or the equivalent target value) does not already include these values, Unity displays a warning message when it compiles the shader, to indicate that it has added these requirements.

hlsl shader viewer

If a shader defines a tessellation stage (with #pragma hull or #pragma domain), Unity automatically adds tessellation to the list of requirements.If a shader defines a geometry stage (with #pragma geometry), Unity automatically adds geometry to the list of requirements.If your shader defines certain shader stages, Unity automatically adds items to the list of requirements.

hlsl shader viewer

Default behaviorīy default, Unity compiles shaders with #pragma require derivatives, which corresponds to #pragma target 2.5.

hlsl shader viewer

If your shader uses features that are not included in the list of requirements, this can result in either compile time errors, or in devices failing to support shaders at runtime. It is important to correctly describe the GPU features that your shader requires. A shader model is a shorthand for a group of GPU features internally, it is the same as a #pragma require directive with the same list of features. You can specify individual GPU features with the #pragma require directive, or specify a shader model with the #pragma target directive. At runtime, Unity uses this information to determine whether a shader program is compatible with the current hardware. More info See in Glossary requires certain GPU features. You can use #pragma directives to indicate that a shader A program that runs on the GPU.











Hlsl shader viewer