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
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
- Shader Graph Node information is briefly displayed in Graph Inspector when clicking on Category in the Blackboard
- Module installation fails with "Download failed: Validation Failed" errors when using beta.2 Hub version
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Shader Graph Category dropdown cannot be expanded/collapsed when clicking on the text
- Different text alignment in the column header in Entities "System" window
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);
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);