I’am trying to use my custom shaders on a Galaxy Tab 3 but they are failing to compile or link. Here is the code. This is the vertex shader
attribute vec4 a_position;
attribute vec2 a_texCoord;
uniform sampler2D u_texture;
varying vec2 blurs[8];
uniform vec2 blurSize;
#ifdef GL_ES
varying lowp vec2 v_texCoord;
#else
varying vec2 v_texCoord;
#endif
void main()
{
gl_Position = CC_MVPMatrix * a_position;
v_texCoord = a_texCoord;
blurs[0] = v_texCoord + vec2(-0.016, 0.0) * blurSize;
blurs[1] = v_texCoord + vec2(-0.012, 0.0) * blurSize;
blurs[2] = v_texCoord + vec2(-0.008, 0.0) * blurSize;
blurs[3] = v_texCoord + vec2(-0.004, 0.0) * blurSize;
blurs[4] = v_texCoord + vec2( 0.004, 0.0) * blurSize;
blurs[5] = v_texCoord + vec2( 0.008, 0.0) * blurSize;
blurs[6] = v_texCoord + vec2( 0.012, 0.0) * blurSize;
blurs[7] = v_texCoord + vec2( 0.016, 0.0) * blurSize;
}
This is the fragment shader
#ifdef GL_ES
precision lowp float;
#endif
varying vec2 v_texCoord;
varying vec2 blurs[8];
uniform sampler2D u_texture;
//uniform vec2 blurSize;
uniform vec4 substract;
void main() {
gl_FragColor = vec4(0.0);
gl_FragColor += texture2D(u_texture, blurs[0])*0.0443;
gl_FragColor += texture2D(u_texture, blurs[1])*0.0776;
gl_FragColor += texture2D(u_texture, blurs[2])*0.1158;
gl_FragColor += texture2D(u_texture, blurs[3])*0.1473;
gl_FragColor += texture2D(u_texture, v_texCoord )*0.1595;
gl_FragColor += texture2D(u_texture, blurs[4])*0.1473;
gl_FragColor += texture2D(u_texture, blurs[5])*0.1158;
gl_FragColor += texture2D(u_texture, blurs[6])*0.0776;
gl_FragColor += texture2D(u_texture, blurs[7])*0.0443;
}
In the ipad, nexus devices and galaxy s3/s4 and note 3 it works fine. But in galaxy tab 3 (with the vivante gc1000 gpu) fails to compile or link; I do not know for sure which one is failing. Here are the errors from logcat:
03-25 20:59:36.328 D/v_gal (3167): [tid=3179] gcmONERROR: status=-10(gcvSTATUS_TOO_COMPLEX) @ _GenerateStates(10194)
03-25 20:59:36.328 D/v_gal (3167): [tid=3179] gcmONERROR: status=-10(gcvSTATUS_TOO_COMPLEX) @ gcLINKTREE_GenerateStates(11342)
03-25 20:59:36.328 D/v_gal (3167): [tid=3179] gcmERR_BREAK: status=-10(gcvSTATUS_TOO_COMPLEX) @ gcLinkShaders(7831)
03-25 20:59:36.328 D/cocos2d-x debug info(3167): cocos2d: ERROR: Failed to link program: 25
03-25 20:59:36.328 D/cocos2d-x debug info(3167): cocos2d: ERROR LOG PROGRAM: (null)
03-25 20:59:36.328 D/v_gal (3167): [tid=3179] gl2mERROR: result=0x0501 @ glGetShaderiv(886)
03-25 20:59:36.328 D/cocos2d-x debug info(3167): cocos2d: ERROR LOG VERTEX: (null)
03-25 20:59:36.328 D/v_gal (3167): [tid=3179] gl2mERROR: result=0x0501 @ glGetShaderiv(886)
03-25 20:59:36.328 D/cocos2d-x debug info(3167): cocos2d: ERROR LOG FRAG: (null)
ERROR LOG PROGRAM, ERROR LOG VERTEX, ERROR LOG FRAG are the calls to glGetProgramInfoLog and glGetShaderInfoLog. They are all returning null
Does anyone have any idea of what could be causing this?
Thanks!