RESOLVED FIXED 110817
Create GraphicsContext3DState to aggregate state objects
https://bugs.webkit.org/show_bug.cgi?id=110817
Summary Create GraphicsContext3DState to aggregate state objects
Bruno Abinader (history only)
Reported 2013-02-25 16:03:27 PST
Aggregate context state-related objects on a GraphicsContext3DState struct, in a similar fashion as GraphicsContext does. This is useful to avoid duplicated values for platform-specific initialization lists.
Attachments
Patch (26.07 KB, patch)
2013-02-25 16:05 PST, Bruno Abinader (history only)
no flags
Bruno Abinader (history only)
Comment 1 2013-02-25 16:05:13 PST
Created attachment 190145 [details] Patch Proposed patch
Antonio Gomes
Comment 2 2013-02-26 06:34:13 PST
(In reply to comment #1) > Created an attachment (id=190145) [details] > Patch > > Proposed patch LGTM, but I will defer to No'am or Mrobinson a final word.
Martin Robinson
Comment 3 2013-02-26 08:03:54 PST
Comment on attachment 190145 [details] Patch I'm not sure adding a new layer in an already byzantine class hierarchy is a good tradeoff for deleting six lines of code. I'm not going to block this patch, but I thought I'd mention that.
Noam Rosenthal
Comment 4 2013-02-26 08:07:50 PST
(In reply to comment #3) > (From update of attachment 190145 [details]) > I'm not sure adding a new layer in an already byzantine class hierarchy is a good tradeoff for deleting six lines of code. I'm not going to block this patch, but I thought I'd mention that. I agree - something about this seems like refactoring for the sake of refactoring.
Bruno Abinader (history only)
Comment 5 2013-02-26 08:08:16 PST
(In reply to comment #3) > (From update of attachment 190145 [details]) > I'm not sure adding a new layer in an already byzantine class hierarchy is a good tradeoff for deleting six lines of code. I'm not going to block this patch, but I thought I'd mention that. The GC3DState struct is also the baseline for an upcoming effort to add more state variables to avoid redundant state changes not covered by this patch (I'll create a bug related to this soon), so in fact the removal of the duplicated values is a plus, not the real goal.
Martin Robinson
Comment 6 2013-02-26 08:17:32 PST
(In reply to comment #5) > The GC3DState struct is also the baseline for an upcoming effort to add more state variables to avoid redundant state changes not covered by this patch (I'll create a bug related to this soon), so in fact the removal of the duplicated values is a plus, not the real goal. Redundantly setting the bound texture, the active texture unit, or the FBO should be fast, unless you have some really poor drivers.
Bruno Abinader (history only)
Comment 7 2013-02-26 08:22:51 PST
(In reply to comment #6) > (In reply to comment #5) > > > The GC3DState struct is also the baseline for an upcoming effort to add more state variables to avoid redundant state changes not covered by this patch (I'll create a bug related to this soon), so in fact the removal of the duplicated values is a plus, not the real goal. > > Redundantly setting the bound texture, the active texture unit, or the FBO should be fast, unless you have some really poor drivers. These are not the target of bug 110883. I'll cover for now just the bottlenecks I've been detecting by profiling EFL's MiniBrowser under gDEBugger tool (so far: blend, stencil, scissor, depth mask-related functions). I've moved these variables to GC3DState for readibility, but I can update the patch just to create GC3DState struct if that's the case.
Bruno Abinader (history only)
Comment 8 2013-02-26 08:23:54 PST
s/readibility/readability/ :)
Bruno Abinader (history only)
Comment 9 2013-02-26 08:31:34 PST
I've uploaded the proposed patch on bug 110883 for your appreciation (depends on the proposed patch from this bug, as it creates the GC3DState struct).
Bruno Abinader (history only)
Comment 10 2013-02-28 08:04:02 PST
@Martin, @Kenneth: I've spoke w/ No'am today about this, he seems fine with the changes (this patch and the complimentary in bug 110883). I agree these changes gives minimum or no optimization on well-implemented drivers, but for others, this could reduce the amount of redundant state changes (speaking of bug 110883). Speaking of which, I've splitted the code in two for clarity, but if it makes more sense to aggregate both patches, please tell me so I can do so.
Kenneth Russell
Comment 11 2013-02-28 14:08:59 PST
Comment on attachment 190145 [details] Patch This refactoring looks good.
WebKit Review Bot
Comment 12 2013-02-28 15:19:32 PST
Comment on attachment 190145 [details] Patch Clearing flags on attachment: 190145 Committed r144378: <http://trac.webkit.org/changeset/144378>
WebKit Review Bot
Comment 13 2013-02-28 15:19:37 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.