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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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);