Skip to content

GLSLCompat.glsllib doesn't compile on Android #2329

Open
@nickidebruyn

Description

@nickidebruyn

While test jme3.7.0 with my android projects I found that the jme3-core/src/main/resources/Common/ShaderLib/GLSLCompat.glsllib
code contains ';' semicolons at the end of the first few lines and android is not happy with that.

Error I am experiencing:

ERROR: 0:11: ';' : Syntax error:  syntax error
INTERNAL ERROR: no main() function!
ERROR: 1 compilation errors.  No code generated.                                                                                                    
                                                                                                    	at com.jme3.renderer.opengl.GLRenderer.updateShaderSourceData(GLRenderer.java:1658)
                                                                                                    	at com.jme3.renderer.opengl.GLRenderer.updateShaderData(GLRenderer.java:1685)
                                                                                                    	at com.jme3.renderer.opengl.GLRenderer.setShader(GLRenderer.java:1750)

After some more investigation I found that the first part is the problem:

#ifdef GL_ES
  #ifdef FRAGMENT_SHADER
    precision highp float;
    precision highp int;
    precision highp sampler2DArray;
    precision highp sampler2DShadow;
    precision highp samplerCube;
    precision highp sampler3D;
    precision highp sampler2D;
    #if __VERSION__ >= 310
      precision highp sampler2DMS;
    #endif
  #endif
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidbugSomething that is supposed to work, but doesn't. More severe than a "defect".

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions