SGX omap4 drivers can't handle changing the contents of and reusing a VBO in multiple draw calls in the same frame

Bug #974170 reported by Alexandros Frantzis
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-omap4-extras-graphics
Fix Released
Undecided
Unassigned

Bug Description

The SGX omap4 drivers can't handle changing the contents of and reusing a VBO in multiple draw calls in the same frame. For example:

/* Upload data to the VBO, and draw */
glBindBuffer(GL_ARRAY_BUFFER, vbo)
glBufferData(...)
glVertexAttribPointer(...)
glDrawArrays(...)

/* Change the data held by the same vbo, and draw again */
glBindBuffer(GL_ARRAY_BUFFER, vbo)
glBufferData(...)
glVertexAttribPointer(...)
glDrawArrays(..)

eglSwapBuffers()

With SGX, both the first and second glDrawArrays(), end up using the VBO contents set by the *second* glBufferData() call. The data uploaded the first time is just ignored. The expected behavior is for the first draw operation to use the data uploaded by the first glBufferData() call, and the second draw operation to use the data uploaded by the second glBufferData() call.

I have created a small example that exhibits this issue: http://people.linaro.org/~afrantzis/reuse-vbo.tar.gz

Use the --separate-vbos option to draw using a separate VBO for each triangle (instead of a single VBO for both)
Use the --draw-line option to draw the second triangle using GL_LINE_LOOP (instead of GL_TRIANGLES), to make things visually clearer

I have attached two images showing the results of running the example on SGX and on desktop r600g using GLES2 with various options. On r600g the results are the same regardless of whether we are using a single VBO or separate VBOs. On SGX, when using a single VBO, the first triangle is drawn (erroneously) using the same vertex data as the second triangle (passed in the second glBufferData()) call.

I think that https://bugs.launchpad.net/ubuntu-omap4-extras-graphics/+bug/912280 is another expression of this problem.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :
description: updated
Revision history for this message
Marc Ordinas i Llopis (marcoil) wrote :

I just managed to test on a Snowball V11 and the bug isn't present there.

Revision history for this message
Rob Clark (rob-ti) wrote :

fwiw, I think I've fixed the gpu crashes w/ compiz in latest 1.9 ddk, and that also seems to fix this issue. So hopefully the fix is coming soon to a PPA near you

Revision history for this message
Rob Clark (rob-ti) wrote :

the fix for this is now in TI OMAP release PPA. I've confirmed that the reuse-vbo test is working properly now, so I believe we can close this bug.

Changed in ubuntu-omap4-extras-graphics:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.