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

Issue 1925663002: command_buffer: Defer restoring of FBO bindings when changing virtual contexts

Created:
4 years, 7 months ago by Kimmo Kinnunen
Modified:
4 years, 7 months ago
Reviewers:
zmo, vmiura
CC:
chromium-reviews, rjkroege, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, piman+watch_chromium.org, darin (slow to review), ben+mojo_chromium.org, Sami Väisänen
Base URL:
https://chromium.googlesource.com/chromium/src.git@lazy-bindframebuffer-03-copy-texture-chromium-instantiation
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

command_buffer: Defer restoring of FBO bindings when changing virtual contexts Defer restoring of FBO bindings when changing virtual contexts. Restoring FBO bindings during MakeCurrent of a virtual context consumes significant amount of the MakeCurrent duration. For GPU rasterization, this work is wasted, as Skia will rebind GL state, including FBOs, for each tile rendered. Defer the FBO binding only during the context state restore, not when client calls BindFramebuffer. This is mainly because the unit test expectations are hard to change correctly. Following operations leave the FBO binding dirty: * Decoder state restore (Virtual context MakeCurrent) * Decoder MakeCurrent (Non-virtual context MakeCurrent) * Client deleting an FBO that is bound * Copying a texture with CopyTextureCHROMIUM * ScopedResolvedFrameBufferBinder Other operations will bind the correct FBO eagerly: * Client calling BindFramebuffer * Decoder switching surfaces * ... These are left to bind eagerly, as the current test expectations are laborous to modify. Later on, if the benefit in uniformity of the decoder code or performance is seen as worth the complication in the test expectation setup, these could be modified too. All the operations that use the FBOs will now call GLES2DecoderImpl::ApplyFramebufferBindings before doing operations that need the FBO. Changes to the tests: * Deleting FBOs do not cause any BindFramebuffer calls, so remove the expectation. * Using another FBO after FBO delete will cause BindFramebuffer call, so add the expectation at the use site. * Few tests did bind the targeted framebuffer multiple times without reason. BUG=603407 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel;tryserver.chromium.win:win_optional_gpu_tests_rel

Patch Set 1 #

Patch Set 2 : rework #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+257 lines, -286 lines) Patch
M gpu/command_buffer/build_gles2_cmd_buffer.py View 1 9 chunks +16 lines, -10 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h View 1 chunk +0 lines, -6 lines 0 comments Download
M gpu/command_buffer/service/framebuffer_manager.h View 1 1 chunk +34 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/framebuffer_manager.cc View 1 1 chunk +60 lines, -4 lines 0 comments Download
M gpu/command_buffer/service/gl_state_restorer_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h View 5 chunks +5 lines, -5 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc View 9 chunks +10 lines, -10 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.h View 1 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 41 chunks +106 lines, -174 lines 2 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_autogen.h View 6 chunks +6 lines, -6 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_mock.h View 1 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc View 1 chunk +1 line, -8 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h View 1 chunk +1 line, -4 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc View 1 chunk +2 lines, -14 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc View 1 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc View 1 4 chunks +6 lines, -26 lines 0 comments Download
M gpu/command_buffer/service/texture_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
M gpu/config/gpu_driver_bug_list_json.cc View 1 3 chunks +4 lines, -4 lines 1 comment Download
M mojo/gpu/mojo_gles2_impl_autogen.h View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gl/gl_enums_implementation_autogen.h View 1 chunk +0 lines, -6 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 7 (4 generated)
Kimmo Kinnunen
4 years, 7 months ago (2016-04-27 13:18:25 UTC) #2
Kimmo Kinnunen
This is part of the work discussed a while ago (see the bug). This seems ...
4 years, 7 months ago (2016-04-28 11:45:27 UTC) #5
vmiura
4 years, 7 months ago (2016-04-28 22:28:20 UTC) #7
Some sites in ::GetHelper may also need to have the FBOs applied.

Good question about how to check if we have full coverage of sites.

Side note, why don't drivers update the FBO lazily themselves?

https://codereview.chromium.org/1925663002/diff/20001/gpu/command_buffer/serv...
File gpu/command_buffer/service/gles2_cmd_decoder.cc (right):

https://codereview.chromium.org/1925663002/diff/20001/gpu/command_buffer/serv...
gpu/command_buffer/service/gles2_cmd_decoder.cc:4732:
MarkFramebufferBindingsChanged();
Based on the previous comment here, we have to ensure the frame buffer is bound
before restoring Viewport settings on some drivers.

Perhaps this could be handled similar to the "restore_scissor_on_fbo_change"
workaround.

https://codereview.chromium.org/1925663002/diff/20001/gpu/command_buffer/serv...
gpu/command_buffer/service/gles2_cmd_decoder.cc:6218: if (attachment ==
GL_DEPTH_STENCIL_ATTACHMENT) {
Also needs ApplyFramebufferBindings(target) ?

Powered by Google App Engine
This is Rietveld 408576698