Hi,
I'm experiencing an error on Adreno 530 when using multiple render targets (MRT) using GL ES 3.0 and GLSL #version 300 es on Android 7 devices. I've observed the behaviour specifically on the Google Pixel, Google Pixel XL, LG V20 and Samsung S7 (Snapdragon 820 version). I have not seen this on any other GPU, and I have tested Adreno 4xx, Adreno 3xx, Mali, PowerVR, Tegra, on Android 4.4 up to Android 7.
The fragment shader code in question is as follows:
#version 300 es precision highp float; layout(location = 0) out vec4 out_a; layout(location = 1) out vec4 out_b;
When linking this shader program I get this error in 50-60% of cases:
Adreno Error: Output out_b location or component exceeds max allowed
If I try the array declaration on out, like below:
#version 300 es precision highp float; out vec4 out_buffers[2];
Adreno Error: Output out_buffers cannot find a suitable location/component.
A similar error as the above is reported here: https://tracker.dev.opencascade.org/bug_revision_view_page.php?rev_id=16888
To debug this problem, I've verified that GL_MAX_DRAW_BUFFERS and GL_MAX_COLOR_ATTACHMENTS are both 4 before the shader linking. I've also bound a non-default framebuffer with multiple color attachements and set glDrawBuffers to multiple combinations of GL_COLOR_ATTACHMENTi, GL_NONE, but none of this has eliminated the error.
The specific version of the Adreno driver on the Google Pixel XL causing this error:
Vendor: Qualcomm
Renderer: Adreno (TM) 530
Version: OpenGL ES 3.2 [email protected] (GIT@Idb2b4cb785)
What leaves me a bit flustered is that this error happens when linking the shader program. With the exception of the Adreno 530, every other GPU is perfectly fine with compiling and linking my fragment shader, even with the default framebuffer with no addtional color attachement. I cannot see the GL ES 3.0 specification mandating such a check when linking shader programs (but I could be wrong).
Is this a known problem with the Adreno 530 or 5xx series drivers? Or is there something required for using MRT in fragment shaders in GL ES 3.0 that I'm missing?
*/
Same issue here! Have you found a workaround?
Hi, csmartdalton!
Nope, the only workaround I've found is to not use MRT at all. Have had to split up shaders into multiple passes. Basically we are at OpenGL 1.x feature level wrt. MRT (i.e no MRT). Really hoping for a solution/workaround here, so if you find something, please let me know!
Regards,
Tom