Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.34f1
2022.3.17f1
2023.2.6f1
2023.3.0b3
6000.0.0b11
6000.1.0a7
7000.0.0a1
Issue ID
UUM-62033
Regression
No
half4 type variables are cased to float4 when shaders are compiled on Metal or GLES graphics API
Reproduction steps:
1. Open the attached “BugRepro“
2. In the Project window, select the “Assets/Shader/TestShader” shader
3. In the inspector, in the “Compile and show code” popup menu, select the Metal graphics API
4. Click “Compile and show code”
5. In the opened code, observe the “u_xlat16_0” and “_TintColor” variables type and their usage
Expected result: the variable type stays the same as the declared type when they are used
Actual result: the variables are cast to float4 when they are used
Reproducible with: 2021.3.34f1, 2022.3.17f1, 2023.2.6f1, 2023.3.0b3
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Note: On the Editor version 2023.3.0b3, in the compilied code the “_TintColor” variable is declared as a float4
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
- Some UXML Template Asset foldouts appear enabled when all fields inside are disabled
- URP Terrain Demo crash on burst_signal_handler after Generating lighting
- Project window button icons are poorly visible and their shades differ in Light theme
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
- Editor crashes on D3D12GetInterface when repeatedly enabling and disabling 256 text components
Resolution Note:
After careful consideration, we decided to not fix this issue at this time.
It is possible to rewrite the code in a way that ends up only using fp16 temporaries:
half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
return lerp(col * _TintColor, _MixColor, i.uv.x);