The default bug view has changed. See this FAQ.

unbind VBO required in order to share GL context with toolkit

RESOLVED FIXED in mozilla11

Status

()

Core
Graphics
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: romaxa, Assigned: romaxa)

Tracking

Trunk
mozilla11
ARM
MeeGo
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

6 years ago
Created attachment 497211 [details] [diff] [review]
Unbind Quad VBO

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-
(Assignee)

Updated

6 years ago
Blocks: 619056
This longer happens, so I assume it got fixed through returning consistent state.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Comment 3

5 years ago
Created attachment 574772 [details] [diff] [review]
Another version of patch, frontend only

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 → ---
(Assignee)

Updated

5 years ago
Attachment #574772 - Flags: review? → review?(joe)
(Assignee)

Updated

5 years ago
Attachment #574772 - Flags: review?(jmuizelaar)
(Assignee)

Comment 4

5 years ago
Created attachment 574977 [details] [diff] [review]
Unbind VBO, Addressed vlad comments
Attachment #574772 - Attachment is obsolete: true
Attachment #574977 - Flags: review?(jmuizelaar)
Attachment #574772 - Flags: review?(joe)
Attachment #574772 - Flags: review?(jmuizelaar)
(Assignee)

Updated

5 years ago
Attachment #574977 - Attachment description: Addressed vlad comments → Unbind VBO, Addressed vlad comments
(Assignee)

Updated

5 years ago
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+
(Assignee)

Updated

5 years ago
Attachment #574977 - Flags: review?(joe)
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
http://hg.mozilla.org/integration/mozilla-inbound/rev/e52370a94c8d
Keywords: checkin-needed
Target Milestone: --- → mozilla11
https://hg.mozilla.org/mozilla-central/rev/e52370a94c8d
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago5 years ago
Resolution: --- → FIXED
(Assignee)

Comment 8

5 years ago
Created attachment 575683 [details] [diff] [review]
Missing returns that also need unbind VBO

Forgot about earlier returns which also needs UnbindVBO
Attachment #575683 - Flags: review?(matt.woodrow)
(Assignee)

Comment 9

5 years ago
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
Last Resolved: 5 years ago5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.