WebGL should shadow GL state so as to minimize state queries

RESOLVED FIXED in mozilla13

Status

()

Core
Canvas: WebGL
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jgilbert, Assigned: jgilbert)

Tracking

unspecified
mozilla13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

6 years ago
In most cases, GL state access should be trivial, but it's not guaranteed to be so, and will probably not be trivial on some drivers.

As such, we should shadow what state we commonly use so as to minimize extra queries.
We already do shadow some state, for the reason you mention.

What more do you think we should shadow?
(Assignee)

Comment 2

6 years ago
I think the only pressing need is framebuffer bindings. I was trying to think if there would be a nice way to make shadowing more general.
(Assignee)

Comment 3

6 years ago
Created attachment 595252 [details] [diff] [review]
Shadow bound FBO ids.

This seems to work.

I'm not sure why my previous attempt didn't work.
Assignee: nobody → jgilbert
Status: NEW → ASSIGNED
Attachment #595252 - Flags: review?(bjacob)
(Assignee)

Comment 4

6 years ago
Created attachment 595267 [details] [diff] [review]
Shadow bound FBO ids.

Fixed a warning.
Attachment #595252 - Attachment is obsolete: true
Attachment #595252 - Flags: review?(bjacob)
Attachment #595267 - Flags: review?(bjacob)
Comment on attachment 595267 [details] [diff] [review]
Shadow bound FBO ids.

Review of attachment 595267 [details] [diff] [review]:
-----------------------------------------------------------------

r=me provided the following is addressed:

::: gfx/gl/GLContext.h
@@ +856,5 @@
> +
> +
> +
> +    GLuint mBoundDrawFBO;
> +    GLuint mBoundReadFBO;

That should probably not be public.
Attachment #595267 - Flags: review?(bjacob) → review+
(Assignee)

Comment 6

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/2c49ea176da2
Target Milestone: --- → mozilla13
(Assignee)

Comment 7

6 years ago
Created attachment 595567 [details] [diff] [review]
Shadow bound FBO ids.

Final patch, carrying r+ forward, and fixing the bug number on the patch. (Patch was pointing at bug 717422)
Attachment #595267 - Attachment is obsolete: true
Attachment #595567 - Flags: review+

Comment 8

6 years ago
https://hg.mozilla.org/mozilla-central/rev/2c49ea176da2
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.