Search Issue Tracker
By Design
Votes
0
Found in
2019.4.17f1
2020.1.16f1
2020.1.17f1
2020.2
2021.1
Issue ID
1298568
Regression
Yes
Custom shaders throw not enough actual parameters for macro UNITY_SAMPLE_TEX2D_SAMPLER_LOD error after Project is upgraded
How to reproduce:
1. Open the attached project named "Case_1298568" with 2020.1.15f1
2. Open the SampleScene
3. Observe the Console window - no errors are thrown
4. Open the attached project with 2020.1.16f1
5. Open the SampleScene
6. Observe the Console window again
Expected results: Shaders do not throw errors as in the previous Editor version
Actual results: Shaders throw "not enough actual parameters for macro 'UNITY_SAMPLE_TEX2D_SAMPLER_LOD' at line 182 (on d3d11) error
Reproducible with: 2019.4.17f1, 2020.1.16f1, 2020.1.17f1, 2020.2.1f1, 2021.1.0a10
Not reproducible with: 2018.4.30f1, 2019.4.16f1, 2020.1.0a1, 2020.1.15f1
Graphics APIs tested - D3D11, D3D12, Vulkan, OpenGLCore
Notes:
1. In 2020.2 and 2021.1 a different error message is thrown:
[ShaderName] 'UNITY_SAMPLE_TEX2D_SAMPLER_LOD': Too few arguments to a macro call. at {ShaderIncludeName]
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
- SerializedPropertyChangeEvent is invoked when initially binding PropertyFields in custom Editor
- UI Panel is not visible when HDR and STP filter are enabled
- Crash on GfxDeviceD3D11Base::DrawBuffersIndirect when opening a specific project
- OnTriggerExit2D is called in Play mode when undoing component adding
- Builds fail with "Execution failed for task ':launcher:checkReleaseDuplicateClasses'" error when the newer version of the In-App Purchasing package is installed on a specific project
Resolution Note:
UNITY_SAMPLE_TEX2D_SAMPLER_LOD did not actually exist until recently. For some reason the user was still checking it with #ifdef and defining it theirself. However, the definition is mismatching with what was recently added to HLSLSupport.cginc
To fix this the user shader either needs to be changed to match with how we define this macro in HLSLSupport.cginc or it must skip the #ifdef check and use their own naming for the macro.