Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.4
2020.2
Issue ID
1281165
Regression
No
[FXC Crash] Shader compiler crashes when a project contains a shader with a conditional on Texture2D
Reproduction steps:
1. Create a new project or open an existing one
2. Import the attached shader ("testPredicate.shader")
3. Observe errors in the console
Expected results: Shader is compiled without any errors
Actual results: Shader crashes the shader compiler
Reproducible with: 2018.4.28f1, 2019.4.9f1, 2020.1.9f1, 2020.2.0b7
Notes:
- Shader compiler seems to keep functioning after the errors
- Editor doesn't crash
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
- SystemInfo.get_graphicsDeviceName() is generating garbage GC Alloc when using Metal graphics API
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
Resolution Note (2021.1.X):
"Texture2D local = pred ? global0 : global1;"
This is not valid HLSL code.
The correct way to do this is to sample both and select from the results, e.g.
float4 glob0 = global0.Sample(...);
float4 glob1 = global1.Sample(...);
float4 result = pred ? glob0 : glob1;