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
- WebGPU error When over 2GB memory consumption
- WebGL error When over 2GB memory consumption
- "Rendering Debugger" displays incorrect overdraw count when using "Unlit/Texture" shader
- Scene and Game views break when the Editor window is snapped with the Microsoft PowerToys
- Materials do not transfer texture when the "Shader" parameter is changed from "Unlit/Texture" to "Universal Render Pipeline/Unlit"
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.