Search Issue Tracker
By Design
Votes
0
Found in
2017.4
2018.4
2019.2
2019.2.14f1
2019.3
2020.1
Issue ID
1208664
Regression
No
[Critical] Certain Shaders remain broken when an undeclared variable is removed
Reproduction steps:
1. Create a new Project
2. Create a new Unlit shader
3. In the struct v2f add the following line "float3 test;"
4. Save the Shader
5. Observe the Shader in the Inspector window. "Shader is not supported on this GPU" error is thrown
6. Delete the added line and save the shader
7. Observe the Inspector window again
Expected behavior: The error message is gone, as the code which caused the error has been removed
Actual behavior: The error remains. Any materials that have been using this shader remain magenta
Reproducible with: 2017.4.36f1, 2018.4.15f1, 2019.2.17f1, 2019.3.2f1, 2020.1.0a23
Notes:
1. Only reproducible with D3D11 and D3D12. Does not reproduce when using Vulkan, Metal or OpenGL. Reimport clears the error when Vulkan or OpenGL is used.
2. Restarting the Editor or Re-importing the assets does not resolve this
3. 2017.4 does not throw an error message, but the materials that use the affected shader remain broken
4. Shaders affected: Unlit/ImageEffect
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note (2020.2.X):
Adding members without semantics into the v2f struct will cause the shader upgrader to add these lines into the shader:
// Upgrade NOTE: excluded shader from DX11; has structs without semantics (struct v2f members test)
#pragma exclude_renderers d3d11
This will exclude DX11/12 targets from this shader (renders pink). After this, removing the struct member alone won't revert the whole shader back where it was. The pragma needs to be removed too in order to make the shader run on DX targets again.