PowerVR support patch (8 posts)

  • Profile picture of 1p said 3 months, 1 week ago:

    PowerVR support patch
    See more details: http://www.imgtec.com/forum/forum_posts.asp?TID=1952

    --- Base (BASE)
    +++ Locally Modified (Based On LOCAL)
    @@ -1025,13 +1025,19 @@
             if (verboseLogging) {
                 logger.info("GLES20.glShaderSource(" + id + ")");
             }
    -
    +        if (source.getType().equals(ShaderType.Vertex)
    +                && GLES20.glGetString(GLES20.GL_RENDERER).indexOf("PowerVR")>=0) {
             GLES20.glShaderSource(
                     id,
    +                     source.getDefines()
    +                    + source.getSource());
    +        } else {
    +            GLES20.glShaderSource(
    +                    id,
                     "precision mediump float;n"
                     + source.getDefines()
                     + source.getSource());
    -
    +        }
             checkGLError();
    
             if (verboseLogging) {
    

    Now, my app works fine on Galaxy S.

    Android market(free)

    https://market.android.com/details?id=jp.co.pscnet.mms.tinyar

  • Profile picture of normen normen1271p said 3 months, 1 week ago:

    For where and what is this supposed to be?

  • Profile picture of 1p said 3 months, 1 week ago:

    The driver of PowreVR SGX540,530 doesn’t support “precision mediump float”.
    It causes a compilation error randomly.
    Please see the link in previous message for more details.

  • Profile picture of normen normen1271p said 3 months, 1 week ago:

    Yeah I got that much.. It would be cool if you could post proper patches with a path.

  • Profile picture of 1p said 3 months, 1 week ago:

    Sorry.

    diff -r f8eeae42eed4 -r 13050bcd3696 engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java
    --- a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java	Thu Feb 02 16:05:11 2012 +0900
    +++ b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java	Mon Feb 06 07:01:14 2012 +0900
    @@ -1025,13 +1025,19 @@
             if (verboseLogging) {
                 logger.info("GLES20.glShaderSource(" + id + ")");
             }
    -
    -        GLES20.glShaderSource(
    -                id,
    -                "precision mediump float;n"
    -                + source.getDefines()
    -                + source.getSource());
    -
    +        if (source.getType().equals(ShaderType.Vertex)
    +                && GLES20.glGetString(GLES20.GL_RENDERER).indexOf("PowerVR")>=0) {
    +            GLES20.glShaderSource(
    +                    id,
    +                     source.getDefines()
    +                    + source.getSource());
    +        } else {
    +            GLES20.glShaderSource(
    +                    id,
    +                    "precision mediump float;n"
    +                    + source.getDefines()
    +                    + source.getSource());
    +        }
             checkGLError();
    
             if (verboseLogging) {
    
  • Profile picture of Momoko_Fan Momoko_Fan366p said 3 months, 1 week ago:

    I looked in the GLSL specification for OpenGL ES and this statement is proper for both vertex shaders and fragment shaders. It seems to me that PowerVR breaks the spec. In any case, it seems that only for the fragment shader this statement is actually required so perhaps can we make the condition for putting it only if the shader is fragment?

  • Profile picture of 1p said 3 months, 1 week ago:

    > I looked in the GLSL specification for OpenGL ES and this statement is proper for both vertex shaders and fragment shaders.

    It’s so.
    However, this statement often causes a compile error if the shader is vertex.
    This is a bug of the driver of PowerVR.

  • Profile picture of Momoko_Fan Momoko_Fan366p said 3 months, 1 week ago:

    OK commited to svn