GL_OES_EGL_image_external not working on Android (PowerVR Rogue GX6250)

I’m trying to use GL_OES_EGL_image_external in a fragment shader along with a texture generated using Android’s SurfaceTexture API. This works as expected on a variety of Android devices, but not one specific device with a GX6250.

Here is my shader and the compiler error:

[  1] #version 300 es
[  2] #extension GL_OES_EGL_image_external : enable
[  3] precision mediump float;
[  4] precision mediump sampler2D;
[  5] precision mediump sampler3D;
[  6] #define tex1D texture
[  7] #define tex3D texture
[  8] #define LUT_POS(x, lut_size) mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))
[  9] out vec4 out_color;
[ 10] in vec2 texcoord0;
[ 11] uniform mat3 colormatrix;
[ 12] uniform vec3 colormatrix_c;
[ 13] uniform vec3 src_luma;
[ 14] uniform vec3 dst_luma;
[ 15] uniform samplerExternalOES texture0;
[ 16] uniform vec2 texture_size0;
[ 17] uniform mat2 texture_rot0;
[ 18] uniform vec2 texture_off0;
[ 19] uniform vec2 pixel_size0;
[ 20] void main() {
[ 21] vec4 color = vec4(0.0, 0.0, 0.0, 1.0);
[ 22] color.rgb = 1.000000 * vec4(texture(texture0, texcoord0)).rgb;
[ 23] color = color.rgbr;
[ 24] color.rgb = mat3(colormatrix) * color.rgb + colormatrix_c;
[ 25] color.a = 1.0;
[ 26] // color mapping
[ 27] color.rgb *= vec3(1.000000);
[ 28] color.rgb *= vec3(1.000000);
[ 29] out_color = color;
[ 30] }
fragment shader compile log (status=0):
Compile failed.
ERROR: 0:22: 'texture' : no matching overloaded function found
ERROR: 1 compilation errors. No code generated.

If I change texture to texture2D, it works. Even though texture2D is deprecated in GLES3

Hi,

As far as we can tell, using “texture” for sampling on OpenGL ES 3.x works fine on our platforms. We believe that you might have hit in a bug introduced quite a while ago on some platforms which was fixed thereafter. Sorry about the inconvenience.

Best regards.

Carlos.