powervr-graphics / Native_SDK

C++ cross-platform 3D graphics SDK. Includes demos & helper code (resource loading etc.) to speed up development of Vulkan, OpenGL ES 2.0 & 3.x applications
https://docs.imgtec.com/sdk-documentation/html/introduction.html
MIT License
702 stars 197 forks source link

[BUG] glVertexAttribDivisor + instanced draw doesn't work correctly #48

Closed zhaijialong closed 4 years ago

zhaijialong commented 4 years ago

Description

glVertexAttribDivisor + instanced draw doesn't work correctly with latest PVRVFrame, it will result in messy rendering result.

incorrect result with PVRVFrame: pvr

correct result with Angle: angle

Repro steps

The code has nothing fancy, just regular instancing rendering code. We have a vertex buffer which contains 10 world matrix for 10 instances, and use glVertexAttribDivisor(..., 1) to specify its "step rate".

If you want, I can send you RenderDoc capture files which can reproduce the bug.

Environment

Additional Info

zhaijialong commented 4 years ago

It turns out this seems to be a issue in nvidia's opengl shader compiler, and we found a workaround for it. closing it.