Search Issue Tracker
By Design
Votes
0
Found in
2022.3.57f1
6000.0.36f1
6000.1.0b3
6000.2.0a1
Issue ID
UUM-96047
Regression
No
Shader errors are thrown when including Input.hlsl in the custom function
Reproduction steps:
1. Open the attached “ShaderGraphCustomFunctionBug.zip” project
2. Open the “Assets/MyShaderGraph.shadergraph” shader graph and observe the MySubgraph node
3. Open the “Assets/MyInclude.cginc” file
4. Uncomment the 5 line
5. Save the file (CTRL+S)
6. Reimport the “Assets/MyInclude.cginc” file (Right-click > Reimport)
7. Observe the MySubgraph node
8. Save the shader (CTRL+S)
9. Observe the Console window
Expected result: No errors are thrown
Actual result: Shader errors are thrown
Reproducible with: 2022.3.57f1, 6000.0.36f1, 6000.1.0b3, 6000.2.0a1
Reproducible on: Windows 11
Not reproducible on: No other environment tested
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Visual artifacts appear when the HD Dynamic Resolution Component changes the resolution scale
- Domain Reload loading popup is dark when Editor Theme is set to "Light"
- Scene Views breaks and errors are spammed in the Console when the Game view is shrunk vertically to the minimum, and the Aspect Ratio is 16:9 or 16:10
- Slider Fill Area disappears after undoing “Set Native Size” change
- Crash with multiple stack traces when playing video on a render texture with low-end graphics devices
Resolution Note:
For the final shader and main preview, Input.hlsl is already included. While including this in a custom function node will cause an error, it's limited to the node's preview shader and not the final shader.
To circumvent situations like these, you can use the "SHADERGRAPH_PREVIEW" define to branch accordingly.