Hello there,
Open GL ES 3.1 here. When I load uniforms to the fragment shader the ‘old way’
Fragment shader:
#version 310 es
//…
uniform ivec4 properties[100];
//…
CPU:
propertiesL = glGetUniformLocation( mProgramH, “properties”);
int array = new int[100];
// …
glUniform4iv( propertiesL , array, 100 , 0);
Then everything works on every GPU I’ve tried. If I however change that to an UBO
#version 310 es
// …
layout (std140) uniform fUniformProperties
{
ivec4 properties[100];
};
CPU:
propBufferIndex = glGetUniformBlockIndex( mProgramH, “fUniformProperties”);
// …
// declare a UNIFORM BUFFER ‘mUBP’, upload it…
// …
int index = mUBP.getIndex();
glBindBufferBase(GL_UNIFORM_BUFFER, PROP_FRAG_UBO_BINDING, index);
glUniformBlockBinding(programH, propBufferIndex , PROP_FRAG_UBO_BINDING);
then everything works on almost all GPUs, but on the Adreno 510 GPU I get
W/Adreno-GSL(30978): <gsl_ldd_control:475>: ioctl fd 26 code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) failed: errno 35 Resource deadlock would occur
W/Adreno-GSL(30978): <log_gpu_snapshot:384>: panel.gpuSnapshotPath is not set.not generating user snapshot
W/Adreno-GSL(30978): <gsl_ldd_control:475>: ioctl fd 26 code 0xc0200933 (IOCTL_KGSL_TIMESTAMP_EVENT) failed: errno 22 Invalid argument
W/Adreno-GSL(30978): <ioctl_kgsl_syncobj_create:2979>: (1b, b, 2112) fail 22 Invalid argument
W/Adreno-GSL(30978): <gsl_ldd_control:475>: ioctl fd 26 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 35 Resource deadlock would occur
W/Adreno-GSL(30978): <log_gpu_snapshot:384>: panel.gpuSnapshotPath is not set.not generating user snapshot
and my app dies.
Yes, I have made sure that PROP_FRAG_UBO_BINDING ( =6) is less than GL_MAX_FRAGMENT_UNIFORM_BLOCKS (=14 on this GPU).
I use 3 different UBOs in my vertex shader, on the CPU side prepared and uploaded in the very same way like the one that’s giving me trouble, and everything works everywhere including the problematic GPU. So it’s really looking like the problem is only in the fragment shader.
The problem manifests itself for sure on the Adreno 510 and - according to a bug report I’ve got - on a device using Adreno 506. I’ve tried this on some 20 different platforms running other GPUs (including some later Adrenos) and it’s working there with no visible problems at all.
The GPU driver identifies itself as
I/Adreno (30978): QUALCOMM build : a7823f5, I59a6815413
I/Adreno (30978): Build Date : 09/23/16
I/Adreno (30978): OpenGL ES Shader Compiler Version: XE031.07.00.00
I/Adreno (30978): Local Branch : mybranch22028469
I/Adreno (30978): Remote Branch : quic/LA.BR.1.3.3_rb2.26
I/Adreno (30978): Remote Branch : NONE
I/Adreno (30978): Reconstruct Branch : NOTHING
Any advice?