Validate ProgramUniformBlockBindings

I am a graphic engineer, and I have developed some features in our game engine.
I have used glDrawElementsInstanced to draw some elements. I called glGenBuffers/glBindBuffer/glBufferData to generate a UBO buffer, and called glMapBufferRange/memcpy/glUnmapBuffer to upload data, and then called glBindBufferRange to bind Uniform buffer.
But I encountered some issues with the PowerVR chip( It runs well on Mali and Qualcomm chips).
The driver of the GPU prints errors:
--------- beginning of main
10-11 12:22:59.755 20773 20855 E IMGSRV : :2349: ValidateProgramUniformBlockBindings: Bound buffer is too small (Bound buffer is 3360 bytes, 5120 bytes expected)
10-11 12:22:59.755 20773 20855 E IMGSRV : :5687: DrawElements: ValidateState() failed
10-11 12:22:59.755 20773 20855 E IMGSRV : :2349: ValidateProgramUniformBlockBindings: Bound buffer is too small (Bound buffer is 3360 bytes, 5120 bytes expected)
10-11 12:22:59.755 20773 20855 E IMGSRV : :5687: DrawElements: ValidateState() failed
10-11 12:22:59.755 20773 20855 E IMGSRV : :2349: ValidateProgramUniformBlockBindings: Bound buffer is too small (Bound buffer is 11200 bytes, 15360 bytes expected)
10-11 12:22:59.755 20773 20855 E IMGSRV : :5687: DrawElements: ValidateState() failed
10-11 12:22:59.755 20773 20855 E IMGSRV : :2349: ValidateProgramUniformBlockBindings: Bound buffer is too small (Bound buffer is 11200 bytes, 15360 bytes expected)
10-11 12:22:59.755 20773 20855 E IMGSRV : :5687: DrawElements: ValidateState() failed

It can be fixed when I modified the bufferSize of glBufferData to n times 5120. Would you please let me know if the UBO size needs to align to 5120 on all PowerVR GPUs?

Device information is:

deviceModel : vivo V2219A
deviceName : vivo Y77
graphicsDeviceName : PowerVR B-Series BXM-8-256
graphicsDeviceType : OpenGLES3
graphicsDeviceVendor : Imagination Technologies
graphicsDeviceVersion : OpenGL ES 3.2 build 1.15@6133109
graphicsMemorySize : 2048
graphicsMultiThreaded : True
graphicsShaderLevel : 50
processorCount : 8
processorFrequency : 2200
processorType : ARM64 FP ASIMD AES
systemMemorySize : 7589

Looking forward to your reply, Thanks.

Hello,

No, there is not any special limit for UBOs that we know about. There is a GLES buffer size limit that should be about 128Mb and there is a max of blocks that you can query with MAX_COMBINED_UNIFORM_BLOCKS.

Maybe you block imposes that limit. i.e. you are using std430 or something similar.

Regards.

Carlos.

Thank you for replying to me, I have checked the source code of our game engine. It’s my fault.
I have patched the array size of the uniform block in the glsl code before compiling it. So the size of UBO doesn’t match the size of the uniform block.