Search Issue Tracker

Not Reproducible

Votes

0

Found in

5.3.4p6

Issue ID

801584

Regression

No

Metal shader compiler treats const variables differently than OpenGLCore compiler

Shaders

-

Reproduction Steps:
1. Open project
2. Pick OSX standalone target
3. Select "NewUnlitShader.shader" in Editor
4. In inspector under "Compile and show code" pick only Metal API
5. Click "Compile and show code"
6. Notice error in the console:

Shader error in 'Unlit/NewUnlitShader': 'const' : non-matching types for const initializer at line 44 (on metal)
Compiling Vertex program
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_NO_LINEAR_COLORSPACE UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_MOBILE SHADER_API_DESKTOP

7. Try the same with OpenGLCore - no errors

Expected behaviour: If GLCore compiles the code, the Metal should compile it too.

Reproduced in versions: Unity 5.3.4p6, 5.3.5p2, 5.4.0b20

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.