Could not compile a shader, which is known to be good for android

I have the following shader taken from the sampele for Android SDK:

   final String vertexShader = 
            "uniform mat4 uMVPMatrix;\n" +
            "attribute vec4 aPosition;\n" +
            "attribute vec2 aTextureCoord;\n" +
            "varying vec2 vTextureCoord;\n" +
            "void main() {\n" +
            "  gl_Position = uMVPMatrix * aPosition;\n" +
            "  vTextureCoord = aTextureCoord;\n" +
            "}\n";

the shader from the opengl es 2.0 example and works fine when I compile the example.

However, when I try to compile a shader in my program, I get:

03-07 17:36:21.109: ERROR/GLES20TEST(5992): Could not compile shader 35633:

There is also the fact that the method:

GLES20.glGetShaderInfoLog(shader)

does not return any information (which, as I understand from my Google research, is a known error)

Does anyone know what I'm doing wrong?

Thanks Jason

+5
source share
1 answer

Solved a problem.

The problem was that I was trying to create a shader outside of OnSurfaceCreate causing thread problems

+9
source

All Articles