- Home /
Shader Fails to Compile on iOS: GL_EXT_frag_depth
I have a very simple masking shader (three, actually, that work in tandem.)
Shader "Custom/CutoutA"
{
SubShader
{
Tags { "Queue" = "Geometry-3" }
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
float4 vert(float4 v:POSITION) : SV_POSITION {
return mul (UNITY_MATRIX_MVP, v);
}
void frag(out float depth:DEPTH)
{
depth = -1;
}
ENDCG
}
}
}
They were working on my iOS device. I switched platforms to a Mac Standalone for a month in order to make a build to show on a tv at an event. I may have also updated from Unity 4.x to Unity 5.x. I can't remember exactly when that happened.
Recently, I've switched back to the mobile build. Upon compiling for device, these masking shaders are no longer working. They appear pink, so I
placed the shaders in the Resources/ folder.
added them to the Included Shaders section of the Graphics settings.
Neither helped.
Eventually I noticed that the runtime log (visible through Xcode while running on device) says the following:
-------- Shader compilation failed
#version 100
#extension GL_EXT_frag_depth : enable
void main ()
{
gl_FragDepthEXT = -1.0;
}
-------- failed compiling:
fragment evaluation shader
-------- GLSL error:
WARNING: 0:4: extension 'GL_EXT_frag_depth' is not supported
ERROR: 0:7: Use of undeclared identifier 'gl_FragDepthEXT'
Note: Creation of internal variant of shader 'Custom/CutoutA' failed.
WARNING: Shader Unsupported: 'Custom/CutoutA' - Setting to default shader.
Anyone have any experience with this? I've been able to view the generated shader code and it looks like it's trying to use the GL_EXT_frag_depth extension.
@$$anonymous$$tman
Did you ever figure this out? I have the same problem, all my games just stopped working one day. They were all working fine the previous day, and now when I do new builds I get the same error.
I am curious if you ever figured out how to fix this. All of my games were on my device working, and now they just stopped working out of the blue a day after I had played them.
When I do a new build, I get the same error as you showed.
This is obviously not an answer, and I did try post it as a reply.
@BAnyBuddle Im on this error just now. Same situation as you. Any fixes?
Same here, i changed nothing on shaders and this error happens only on my iPhone 4S iOS Version 9.3.5 I've tested it on iPad iOS 10 and it works perfectly.
Did you find a solution?
Your answer
Follow this Question
Related Questions
Snow scene is a neon blue in an iOS build, but looks normal on the computer 1 Answer
iOS Custom Specular Shader 2 Answers
How to create a mirror reflection for mobile devices 1 Answer
How to get IOS build to not fail with Shader Errors? FXAA (Hidden Shader related) 0 Answers
Different Shader Display on 3gs vs. 4s 2 Answers