Closed Bug 618765 Opened 14 years ago Closed 13 years ago

unbind VBO required in order to share GL context with toolkit

Categories

(Core :: Graphics, defect)

ARM
MeeGo
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: romaxa, Assigned: romaxa)

References

Details

Attachments

(2 files, 2 obsolete files)

Attached patch Unbind Quad VBO (obsolete) — Splinter Review
On attempt to render mozilla layout with OGL Manager togeter with Qt/Meego toolkit items (statusbar, FPS renderer, and other possible items on QGraphicsScene) I see this error:
PVR:Aborting: Offset to VBO out of bounds. Likely an app bug in glVertexAttribPointer!

Comment from internal bugzilla:

**************
The error message you're getting indicates that the app is trying use geometry
from a vertex buffer object (VBO) with an offset that goes beyond the end of
the buffer. The most common cause for this is forgetting to unbind a VBO before
using a client-side vertex attribute array. For example:

    glVertexAttribPointer(attr, 3, GL_FLOAT, GL_FALSE, 0, &someArray[0]);

should be

    glBindBuffer(GL_ARRAY_BUFFER, 0);
    glVertexAttribPointer(attr, 3, GL_FLOAT, GL_FALSE, 0, &someArray[0]);

This is because if a vertex buffer object is bound when glVertexAttribPointer
is called, the last parameter is interpreted as an offset into the VBO instead
of an absolute memory pointer.
**************
Attachment #497211 - Flags: review?(vladimir)
Comment on attachment 497211 [details] [diff] [review]
Unbind Quad VBO

ugh.  this is a Qt bug, but we have to work around it (if it depends on GL state, it should set that state!).

No need for an UnbindQuadVBO function, it's got nothing to do with the Quad VBO.

We should bind buffer 0 again at the end of Initialize (like you have), and also at the end of Render.  No need to bind it at the end of every quad draw, and in fact that'll be pretty expensive.  (We actually want to do even fewer state changes in there, but at some point we'll want to add state tracking to GLContext to do that).  We shouldn't ever have Qt GL rendering in the middle of our own rendering, so as long as we return a GL state back to Qt, we should be fine.
Attachment #497211 - Flags: review?(vladimir) → review-
Blocks: 619056
This longer happens, so I assume it got fixed through returning consistent state.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Problem still exists, and I see it from time to time.
Also this API needed for native Embedding, right after EndTransaction we must unbind vbo in order to get it working in embedding context
Assignee: nobody → romaxa
Attachment #497211 - Attachment is obsolete: true
Status: RESOLVED → REOPENED
Attachment #574772 - Flags: review?
Resolution: FIXED → ---
Attachment #574772 - Flags: review? → review?(joe)
Attachment #574772 - Flags: review?(jmuizelaar)
Attachment #574772 - Attachment is obsolete: true
Attachment #574977 - Flags: review?(jmuizelaar)
Attachment #574772 - Flags: review?(joe)
Attachment #574772 - Flags: review?(jmuizelaar)
Attachment #574977 - Attachment description: Addressed vlad comments → Unbind VBO, Addressed vlad comments
Attachment #574977 - Flags: review?(joe)
Comment on attachment 574977 [details] [diff] [review]
Unbind VBO, Addressed vlad comments

mwoodrow says this is fine.
Attachment #574977 - Flags: review?(jmuizelaar) → review+
Attachment #574977 - Flags: review?(joe)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e52370a94c8d
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Forgot about earlier returns which also needs UnbindVBO
Attachment #575683 - Flags: review?(matt.woodrow)
Need to land additional patch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #575683 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/mozilla-central/rev/5ebeef1eabcb
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: