Last Comment Bug 717442 - WebGL should shadow GL state so as to minimize state queries
: WebGL should shadow GL state so as to minimize state queries
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla13
Assigned To: Jeff Gilbert [:jgilbert]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-11 15:37 PST by Jeff Gilbert [:jgilbert]
Modified: 2012-02-09 10:18 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Shadow bound FBO ids. (3.68 KB, patch)
2012-02-07 16:52 PST, Jeff Gilbert [:jgilbert]
no flags Details | Diff | Splinter Review
Shadow bound FBO ids. (3.69 KB, patch)
2012-02-07 17:55 PST, Jeff Gilbert [:jgilbert]
jacob.benoit.1: review+
Details | Diff | Splinter Review
Shadow bound FBO ids. (4.36 KB, patch)
2012-02-08 16:10 PST, Jeff Gilbert [:jgilbert]
jgilbert: review+
Details | Diff | Splinter Review

Description Jeff Gilbert [:jgilbert] 2012-01-11 15:37:29 PST
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.
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2012-01-11 16:02:31 PST
We already do shadow some state, for the reason you mention.

What more do you think we should shadow?
Comment 2 Jeff Gilbert [:jgilbert] 2012-01-11 17:20:29 PST
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.
Comment 3 Jeff Gilbert [:jgilbert] 2012-02-07 16:52:54 PST
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.
Comment 4 Jeff Gilbert [:jgilbert] 2012-02-07 17:55:36 PST
Created attachment 595267 [details] [diff] [review]
Shadow bound FBO ids.

Fixed a warning.
Comment 5 Benoit Jacob [:bjacob] (mostly away) 2012-02-07 18:23:58 PST
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.
Comment 7 Jeff Gilbert [:jgilbert] 2012-02-08 16:10:13 PST
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)
Comment 8 Ed Morley [:emorley] 2012-02-09 10:18:31 PST
https://hg.mozilla.org/mozilla-central/rev/2c49ea176da2

Note You need to log in before you can comment on or make changes to this bug.