- May 14, 2015 at 2:06 pm #48743
We’re seeing a problem here with some recent shader optimizations where precision qualifiers on samplers (GLES 3.00) aren’t being stripped before being passed to the underlying GL implementation (where they are invalid; only types int and float are allowed).
NVidia GL drivers are permissive and allow this, but ATI GL drivers rightfully throw an error and fail the compile.
I’ll file a ticket for the fix, but is there a recommended work-around for this? Removing the precision statement alone isn’t sufficient.
For instance, this GLES-SL 3.00 shader:
#version 300 es precision mediump float; precision lowp sampler2DArray; uniform sampler2DArray aTexture; …
is translated as this GL-SL shader:
#version 330 core #define PVR_GL_FRAGMENT_PRECISION_HIGH #define PVR_GL_ES 1 #define gl_MaxTextureImageUnits 8 #define gl_MaxFragmentUniformVectors 64 #define gl_MaxVertexUniformVectors 128 #define gl_MaxVaryingVectors 8 #define gl_MaxCombinedTextureImageUnits 8 #define PVR_highp #define PVR_mediump #define PVR_lowp precision lowp sampler2DArray; // <—— THIS is a syntax error —– uniform sampler2DArray aTexture; …May 14, 2015 at 4:10 pm #48746
Thanks for reporting. I’ve filed the bug as BRN55840.
>is there a recommended work-around for this? Removing the precision statement alone isn’t sufficient.
I’ll discuss with the PVRVFrame lead to see if the issue can be worked around.May 15, 2015 at 8:28 am #48749
We’ve found a workaround. The bug is specific to the stripping of default precision statements for samplers. If you explicitly state the precision instead of relying on the default, then PVRVFrame will correctly strip the precision qualifier before passing the resultant GLSL shader to the host.
precision lowp sampler2D; uniform sampler2D ATexture; uniform sampler2D BTexture; uniform sampler2D CTexture;
uniform lowp sampler2D ATexture; uniform lowp sampler2D BTexture; uniform lowp sampler2D CTexture;