I have been working on an app but I am getting to some errors I cant explain. these errors only appear on my oneplus 3 but not using the google nexus 6p genymotion emulator.
I have searched for hours but i couldn't find an awnser.
this is my compilation code:
public static int loadShader(int shaderType, String source){
int shader = GLES20.glCreateShader(shaderType);
if (shader != 0) {
GLES20.glShaderSource(shader, source);
GLES20.glCompileShader(shader);
int[] compiled = new int[1];
GLES20.glGetShaderiv(shader,GLES20.GL_COMPILE_STATUS, compiled,0);
if (compiled[0] == 0) {
Log.e(TAG, "Could not compile shader " + shaderType + ":");
Log.e(TAG, GLES20.glGetShaderInfoLog(shader));
GLES20.glDeleteShader(shader);
shader = 0;
}
}
return shader;
}
my fragment shader:
precision mediump float;
uniform vec4 vColor;
void main() {
gl_FragColor = vColor;
}
this is the error:
E/MyGLRenderer: Could not compile shader 35632:
E/MyGLRenderer: ERROR: 0:1: 'in' : Syntax error: syntax error
INTERNAL ERROR: no main() function!
ERROR: 1 compilation errors. No code generated.