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

Issue 797533002: Add a glBegin/End pair to make glBindFramebuffer work (Closed)

Created:
6 years ago by ccameron
Modified:
6 years ago
CC:
chromium-reviews, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Add a glBegin/End pair to make glBindFramebuffer work It appears that this fixes the issue where rendered contents wouldn't appear on the screen. I say "it appears" because this bug is very difficult to repro, and so I can never say it's actually gone, just that I wasn't able to make it happen anymore. I can come up with a line of reasoning that the glBegin/End causes the driver to go and validate its internal state. Perhaps sometimes the dirty bit for the FBO is missed (and doing the glBegin/End immediately after changing the FBO ensure it's picked up). Ultimately it is just a guess. This workaround was discovered by accident through the following sequence of steps when debugging: 1. Draw a triangle to the CAOpenGLLayer after drawing the texture, to ensure that we are actually getting draw calls - This appeared and kept updating even when the texture stopped updating 2. Draw a triangle to the FBO's texture from the CAOpenGLLayer's context, to make sure changes to the texture would go through - This appeared and kept updating even when the textures topped updating (so it's probably a problem with the command buffer context). 3. Draw a triangle to the FBO's texture from the command buffer's context just before glSwapBuffers - This triangle never appeared, so I tried the next experiment. 4. Draw a triangle to the FBO's texture right after it is bound using glBindFramebufferEXT - Suddenly the bug went away (and I never saw the triangle, because it was drawn over). 5. Just do a glBegin/End with program 0, since we found this was enough to work around driver bugs in the past. - Still couldn't repro the bug with this. BUG=435786 Committed: https://crrev.com/4ff12a73e3ec88084f1803f3fbbe998e079d5c8e Cr-Commit-Position: refs/heads/master@{#308166}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Fix compile #

Total comments: 2

Patch Set 3 : Incorporate review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -1 line) Patch
M content/common/gpu/image_transport_surface_fbo_mac.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/common/gpu/image_transport_surface_fbo_mac.mm View 1 2 1 chunk +36 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M gpu/config/gpu_driver_bug_list_json.cc View 1 2 chunks +12 lines, -1 line 0 comments Download
M gpu/config/gpu_driver_bug_workaround_type.h View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gl/gl_surface.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gl/gl_surface.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (6 generated)
ccameron
I think we need to update the Unified OpenGL Debugging Methodology from https://code.google.com/p/chromium/issues/detail?id=318877#c12
6 years ago (2014-12-11 03:52:40 UTC) #2
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/797533002/diff/1/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/797533002/diff/1/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode4288 gpu/command_buffer/service/gles2_cmd_decoder.cc:4288: glEnd(); I'm surprised this compiles. This file is supposed ...
6 years ago (2014-12-11 07:06:37 UTC) #3
ccameron
Good point -- I've moved the location of the workaround to avoid the ODR issues. ...
6 years ago (2014-12-11 09:57:31 UTC) #4
ccameron
Ping this again (I think this version is ready).
6 years ago (2014-12-12 00:21:21 UTC) #5
Ken Russell (switch to Gerrit)
Thanks for reorganizing this. The new version LGTM. https://codereview.chromium.org/797533002/diff/1/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/797533002/diff/1/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode4291 gpu/command_buffer/service/gles2_cmd_decoder.cc:4291: glUseProgram(old_program); ...
6 years ago (2014-12-12 02:30:45 UTC) #6
ccameron
Thanks! https://codereview.chromium.org/797533002/diff/20001/ui/gl/gl_surface.h File ui/gl/gl_surface.h (right): https://codereview.chromium.org/797533002/diff/20001/ui/gl/gl_surface.h#newcode93 ui/gl/gl_surface.h:93: virtual void WasBound(); On 2014/12/12 02:30:44, Ken Russell ...
6 years ago (2014-12-12 16:17:36 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/797533002/40001
6 years ago (2014-12-12 16:19:22 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/30056)
6 years ago (2014-12-12 16:25:10 UTC) #11
ccameron
Adding Victor to stamp command buffer changes
6 years ago (2014-12-12 19:11:25 UTC) #12
bajones
On 2014/12/12 at 19:11:25, ccameron wrote: > Adding Victor to stamp command buffer changes This ...
6 years ago (2014-12-12 21:30:07 UTC) #13
ccameron
Thanks! (and sorry for showing you things that you now can't unsee).
6 years ago (2014-12-12 21:32:26 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/797533002/40001
6 years ago (2014-12-12 21:33:59 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
6 years ago (2014-12-12 21:38:30 UTC) #19
commit-bot: I haz the power
6 years ago (2014-12-12 21:39:21 UTC) #20
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/4ff12a73e3ec88084f1803f3fbbe998e079d5c8e
Cr-Commit-Position: refs/heads/master@{#308166}

Powered by Google App Engine
This is Rietveld 408576698