Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Issue 104833007: Restore only modified texture state during virtual context switches (Closed)

Created:
7 years ago by kaanb
Modified:
7 years ago
Reviewers:
no sievers, piman
CC:
chromium-reviews, piman+watch_chromium.org, Tom Hudson, Sami (do not use), klobag.chromium
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

In this patch we track texture state that has been modified by a virtual context and only restore the modified texture state during context switches. The most CPU consuming operations on the GPU thread for Android are virtual context switches. Previously we would restore all texture units (there are 32 units on Nexus 7 and Nexus 10) and all applicable targets for every context switch. With this patch we only restore GL_TEXTURE0 unit and GL_TEXTURE_2D target most of the time. BUG=244701

Patch Set 1 #

Patch Set 2 : Upload after rebase #

Patch Set 3 : Fixes and cleanup #

Patch Set 4 : More cleanup #

Patch Set 5 : More cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+233 lines, -45 lines) Patch
M gpu/command_buffer/service/context_state.h View 1 2 3 4 2 chunks +9 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/context_state.cc View 1 2 3 4 chunks +44 lines, -23 lines 0 comments Download
M gpu/command_buffer/service/gl_state_restorer_impl.h View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M gpu/command_buffer/service/gl_state_restorer_impl.cc View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.h View 1 2 3 3 chunks +4 lines, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 3 3 chunks +7 lines, -5 lines 0 comments Download
A ui/gl/dirty_texture_state.h View 1 2 1 chunk +59 lines, -0 lines 0 comments Download
A ui/gl/dirty_texture_state.cc View 1 2 3 4 1 chunk +56 lines, -0 lines 0 comments Download
M ui/gl/gl.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gl/gl_gl_api_implementation.h View 1 2 3 chunks +12 lines, -0 lines 0 comments Download
M ui/gl/gl_gl_api_implementation.cc View 1 2 3 4 chunks +28 lines, -9 lines 0 comments Download
M ui/gl/gl_state_restorer.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
kaanb
7 years ago (2013-12-16 17:29:58 UTC) #1
no sievers
Can't we just dynamically generate dirty state from comparing old vs. new ContextState during the ...
7 years ago (2013-12-16 19:02:08 UTC) #2
kaanb
On 2013/12/16 19:02:08, sievers wrote: > Can't we just dynamically generate dirty state from comparing ...
7 years ago (2013-12-17 10:39:46 UTC) #3
Sami
It does seem like we'd want to reuse as much as of the existing gpu ...
7 years ago (2013-12-17 18:03:08 UTC) #4
no sievers
On 2013/12/17 10:39:46, kaanb wrote: > On 2013/12/16 19:02:08, sievers wrote: > > Can't we ...
7 years ago (2013-12-17 18:22:41 UTC) #5
Sami
On 2013/12/17 18:22:41, sievers wrote: > Well, that can be solved, but I'm not sure ...
7 years ago (2013-12-17 18:27:10 UTC) #6
kaanb
On 2013/12/17 18:27:10, Sami wrote: > On 2013/12/17 18:22:41, sievers wrote: > > Well, that ...
7 years ago (2013-12-17 19:22:05 UTC) #7
no sievers
On 2013/12/17 19:22:05, kaanb wrote: > On 2013/12/17 18:27:10, Sami wrote: > > On 2013/12/17 ...
7 years ago (2013-12-17 19:35:10 UTC) #8
kaanb
7 years ago (2013-12-18 14:19:01 UTC) #9
On 2013/12/17 19:35:10, sievers wrote:
> On 2013/12/17 19:22:05, kaanb wrote:
> > On 2013/12/17 18:27:10, Sami wrote:
> > > On 2013/12/17 18:22:41, sievers wrote:
> > > > Well, that can be solved, but I'm not sure if we even have to generate
> > > anything.
> > > > Can't we just pass old_state into the restorer and make the right
> decisions?
> > > 
> > > We were also talking about doing just-in-time state restoration where we'd
> > make
> > > sure the bindings are correct at the latest possible time, e.g., right
> before
> > a
> > > draw call. That's much more error prone but also more optimal.
> > 
> > How does exposing ContextState as an opaque void* pointer to the
VirtualGLApi
> > class
> > and passing it to the GLStateRestorerImpl::RestoreState() and casting it to
> the
> > correct
> > type there sound? Within GLStateRestorerImpl::RestoreState() we can compute
> the
> > diff as
> > sievers@ suggested.
> 
> You can just fwd declare "class ContextState;". I don't *think* that violates
> DEPS.
> 
> But why not just pass the other GLStateRestorer or some other known object
that
> you can then get what you need from in the implementation?

Ok, I have a new patch here: https://codereview.chromium.org/118203002/
Let's continue the discussion there.

Powered by Google App Engine
This is Rietveld 408576698