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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
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.