0

I followed https://stackoverflow.com/a/31095254/6655884 and did the following (added \n line break to version directive)

public class OrwellShaders {
    public class Vertex {
        public static final String vertex  = 
            "#version 330 es\n " +
            "layout (location = 0) in vec3 aPos;\n " +
            "layout (location = 1) in vec2 aTexCoord;\n " +
            "\n " +
            "out vec2 TexCoord;\n " +
            "\n " +
            "void main()\n " +
            "{\n " +
            "    gl_Position = vec4(aPos, 1.0);\n " +
            "    TexCoord = vec2(aTexCoord.x, aTexCoord.y);\n " +
            "};\n";
    }

but I'm still getting Adreno error Invalid #version shader

My phone has Android 8 so it should have support. I'm not using GLSurfaceView so there's no setEGLContextClientVersion(3) Im just using

egl = (EGL10) EGLContext.getEGL();
        eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
        if (eglDisplay == EGL10.EGL_NO_DISPLAY) {
        //...
genpfault
  • 51,148
  • 11
  • 85
  • 139
PPP
  • 1,279
  • 1
  • 28
  • 71
  • 1
    The version `#version 330 es` doesn't exist. The most recent GLSL ES version is 3.20 (`#version 320 es`), but there is a desktop GLSL version 3.30 (`#version 330` respectively `#version 330 core`) – Rabbid76 Oct 30 '19 at 20:18

1 Answers1

1

Remove "#version 330 es\n". I had a similar error and deleting this made the GLSL compile

murage kibicho
  • 546
  • 5
  • 14