# Validate ProgramUniformBlockBindings

**URL:** <https://forums.imgtec.com/t/validate-programuniformblockbindings/3603>\
**Category:** PowerVR Insider\
**Created:** [October 21, 2022, 3:59am UTC](https://forums.imgtec.com/t/validate-programuniformblockbindings/3603 "2022-10-21T03:59:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rootvy](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@rootvy](https://forums.imgtec.com/u/rootvy)\
**Post date:** [October 21, 2022, 3:59am UTC](https://forums.imgtec.com/t/validate-programuniformblockbindings/3603/1 "2022-10-21T03:59:04Z")

</div>

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](mailto: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.

---

<div class="post-metadata">

**Author:** ![CarlosSarria](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/carlossarria/32/263_2.png) [@CarlosSarria](https://forums.imgtec.com/u/CarlosSarria)\
**Post date:** [October 21, 2022, 10:32am UTC](https://forums.imgtec.com/t/validate-programuniformblockbindings/3603/2 "2022-10-21T10:32:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rootvy](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@rootvy](https://forums.imgtec.com/u/rootvy)\
**Post date:** [November 1, 2022, 7:57am UTC](https://forums.imgtec.com/t/validate-programuniformblockbindings/3603/3 "2022-11-01T07:57:37Z")

</div>

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.
