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.