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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
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.