Search Issue Tracker
Not Reproducible
Votes
0
Found in
5.6.1f1
Issue ID
944214
Regression
No
[Metal][iOS] Weather/Diffuse Shader error: "Compilation failed: cannot use as_type cast"
Steps to reproduce:
1. Open the attached project
2. Build to iOS
3. Observe the cube in iOS device
Expected result: cube is black&white
Actual result: cube is pink, Debug log is flooded with these messages:
Compilation failed:
program_source:97:29: error: cannot use as_type to cast from 'half' to 'int', types of different size
u_xlati9 = u_xlatb2.y ? as_type<int>(u_xlat16_2.x) : int(0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
program_source:115:53: error: cannot use as_type to cast from 'half' to 'unsigned int', types of different size
u_xlati22 = int(uint(u_xlatb22) * 0xffffffffu | as_type<uint>(u_xlat16_2.y));
^~~~~~~~~~~~~~~~~~~~~~~~~~~
program_source:119:34: error: cannot use as_type to cast from 'half' to 'int', types of different size
u_xlati22 = u_xlatb4.y ? as_type<int>(u_xlat16_2.x) : int(0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
Reproduced on: 5.5.4p2, 5.6.3f1, 2017.1.0p5, 2017.2.0b6 (Metal)
Could not reproduce on: 2017.3.0a4, on this version the shader has a compile error in the editor:
Too many texture interpolators would be used for ForwardBase pass (11 out of max 10)
Thus the cube is purely white on both Metal and OpenGLES2
______
FIXED IN 2017.3
The line "#pragma target 3.0" should be commented out or removed.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
Add comment