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

Issue 2302323002: Reset PIXEL_UNPACK_BUFFER at texture manager initialization time (Closed)

Created:
4 years, 3 months ago by qiankun
Modified:
4 years, 3 months ago
CC:
chromium-reviews, piman+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reset PIXEL_UNPACK_BUFFER at texture manager initialization time Otherwise, there will be some weird GL errors on some GL drivers. BUG=641643, 644572 TEST=conformance2/misc/getextension-while-pbo-bound-stability.html CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Committed: https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655 Cr-Commit-Position: refs/heads/master@{#417685}

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : update expectation #

Total comments: 4

Patch Set 4 : rebase only #

Patch Set 5 : reset at TextureManager::Initialize time #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -17 lines) Patch
M content/test/gpu/gpu_tests/webgl2_conformance_expectations.py View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/test_helper.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/service/test_helper.cc View 1 2 3 4 2 chunks +9 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/texture_manager.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 3 comments Download
M gpu/command_buffer/service/texture_manager_unittest.cc View 1 2 3 4 11 chunks +34 lines, -13 lines 0 comments Download

Messages

Total messages: 51 (13 generated)
qiankun
PTAL.
4 years, 3 months ago (2016-09-02 15:35:32 UTC) #3
Zhenyao Mo
https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode3011 gpu/command_buffer/service/gles2_cmd_decoder.cc:3011: glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); Thanks for tracking down the problem, but ...
4 years, 3 months ago (2016-09-02 17:10:23 UTC) #4
qiankun
https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode3011 gpu/command_buffer/service/gles2_cmd_decoder.cc:3011: glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); On 2016/09/02 17:10:23, Zhenyao Mo wrote: > ...
4 years, 3 months ago (2016-09-02 23:12:02 UTC) #5
Zhenyao Mo
On 2016/09/02 23:12:02, qiankun wrote: > https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc > File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): > > https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode3011 > ...
4 years, 3 months ago (2016-09-02 23:17:42 UTC) #6
Zhenyao Mo
+kainino
4 years, 3 months ago (2016-09-02 23:18:06 UTC) #8
Kai Ninomiya
In investigating this crash, Ken and I found that there was an apparent misordering of ...
4 years, 3 months ago (2016-09-03 01:30:46 UTC) #9
Ken Russell (switch to Gerrit)
After a lot of investigation this might in fact be the correct and simplest way ...
4 years, 3 months ago (2016-09-07 03:37:01 UTC) #11
Zhenyao Mo
On 2016/09/07 03:37:01, Ken Russell wrote: > After a lot of investigation this might in ...
4 years, 3 months ago (2016-09-07 03:55:16 UTC) #12
vmiura
On 2016/09/07 03:55:16, Zhenyao Mo wrote: > On 2016/09/07 03:37:01, Ken Russell wrote: > > ...
4 years, 3 months ago (2016-09-07 05:11:01 UTC) #13
Zhenyao Mo
qiankun, per discussion, let's land this after you address the comments. https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): ...
4 years, 3 months ago (2016-09-08 18:19:23 UTC) #14
qiankun
https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode3010 gpu/command_buffer/service/gles2_cmd_decoder.cc:3010: if (version_info->IsAtLeastGL(3, 2) || version_info->IsAtLeastGLES(3, 0)) On 2016/09/08 18:19:23, ...
4 years, 3 months ago (2016-09-09 02:06:44 UTC) #15
Zhenyao Mo
On 2016/09/09 02:06:44, qiankun wrote: > https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc > File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): > > https://codereview.chromium.org/2302323002/diff/40001/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode3010 > ...
4 years, 3 months ago (2016-09-09 02:32:50 UTC) #16
Kai Ninomiya
On 2016/09/09 02:32:50, Zhenyao Mo wrote: > On 2016/09/09 02:06:44, qiankun wrote: > > > ...
4 years, 3 months ago (2016-09-09 02:44:27 UTC) #19
qiankun
On 2016/09/09 02:32:50, Zhenyao Mo wrote: > On 2016/09/09 02:06:44, qiankun wrote: > > > ...
4 years, 3 months ago (2016-09-09 03:08:09 UTC) #21
Zhenyao Mo
On 2016/09/09 03:08:09, qiankun wrote: > On 2016/09/09 02:32:50, Zhenyao Mo wrote: > > On ...
4 years, 3 months ago (2016-09-09 03:31:15 UTC) #24
Zhenyao Mo
On 2016/09/09 03:31:15, Zhenyao Mo wrote: > On 2016/09/09 03:08:09, qiankun wrote: > > On ...
4 years, 3 months ago (2016-09-09 03:34:03 UTC) #25
qiankun
Updated the code. Please review again. https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc File gpu/command_buffer/service/texture_manager.cc (right): https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc#newcode1785 gpu/command_buffer/service/texture_manager.cc:1785: if (feature_info_->gl_version_info().is_es3_capable) { ...
4 years, 3 months ago (2016-09-09 09:52:48 UTC) #27
Zhenyao Mo
https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc File gpu/command_buffer/service/texture_manager.cc (right): https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc#newcode1785 gpu/command_buffer/service/texture_manager.cc:1785: if (feature_info_->gl_version_info().is_es3_capable) { On 2016/09/09 09:52:48, qiankun wrote: > ...
4 years, 3 months ago (2016-09-09 15:17:08 UTC) #28
qiankun
https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc File gpu/command_buffer/service/texture_manager.cc (right): https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc#newcode1785 gpu/command_buffer/service/texture_manager.cc:1785: if (feature_info_->gl_version_info().is_es3_capable) { On 2016/09/09 15:17:08, Zhenyao Mo wrote: ...
4 years, 3 months ago (2016-09-09 18:16:26 UTC) #29
Kai Ninomiya
On 2016/09/09 18:16:26, qiankun wrote: > https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc > File gpu/command_buffer/service/texture_manager.cc (right): > > https://codereview.chromium.org/2302323002/diff/80001/gpu/command_buffer/service/texture_manager.cc#newcode1785 > ...
4 years, 3 months ago (2016-09-09 18:40:33 UTC) #30
Zhenyao Mo
On 2016/09/09 18:40:33, Kai Ninomiya wrote: > On 2016/09/09 18:16:26, qiankun wrote: > > > ...
4 years, 3 months ago (2016-09-09 18:48:02 UTC) #31
Zhenyao Mo
On 2016/09/09 18:48:02, Zhenyao Mo wrote: > On 2016/09/09 18:40:33, Kai Ninomiya wrote: > > ...
4 years, 3 months ago (2016-09-09 18:48:37 UTC) #32
qiankun
On 2016/09/09 18:40:33, Kai Ninomiya wrote: > On 2016/09/09 18:16:26, qiankun wrote: > > > ...
4 years, 3 months ago (2016-09-09 18:49:47 UTC) #33
qiankun
Thank you all for review and suggestions. Landing now.
4 years, 3 months ago (2016-09-09 18:55:11 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2302323002/80001
4 years, 3 months ago (2016-09-09 18:55:55 UTC) #36
Ken Russell (switch to Gerrit)
On 2016/09/09 18:55:55, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
4 years, 3 months ago (2016-09-09 19:00:57 UTC) #37
vmiura
Can I confirm, are we clearing GL_PIXEL_UNPACK_BUFFER only in TextureManager::Initialize()? If so, that will only ...
4 years, 3 months ago (2016-09-09 19:26:11 UTC) #38
Zhenyao Mo
On 2016/09/09 19:26:11, vmiura wrote: > Can I confirm, are we clearing GL_PIXEL_UNPACK_BUFFER only in ...
4 years, 3 months ago (2016-09-09 20:05:23 UTC) #39
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-09-09 20:14:25 UTC) #41
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655 Cr-Commit-Position: refs/heads/master@{#417685}
4 years, 3 months ago (2016-09-09 20:16:17 UTC) #43
qiankun
On 2016/09/09 20:05:23, Zhenyao Mo wrote: > On 2016/09/09 19:26:11, vmiura wrote: > > Can ...
4 years, 3 months ago (2016-09-10 01:16:59 UTC) #44
vmiura
On 2016/09/09 20:05:23, Zhenyao Mo wrote: > On 2016/09/09 19:26:11, vmiura wrote: > > Can ...
4 years, 3 months ago (2016-09-10 04:50:17 UTC) #45
Zhenyao Mo
On 2016/09/10 04:50:17, vmiura wrote: > On 2016/09/09 20:05:23, Zhenyao Mo wrote: > > On ...
4 years, 3 months ago (2016-09-10 15:46:59 UTC) #46
vmiura
message: On 2016/09/10 04:50:17, vmiura wrote: > On 2016/09/09 20:05:23, Zhenyao Mo wrote: > > ...
4 years, 3 months ago (2016-09-12 04:18:52 UTC) #47
vmiura
On 2016/09/10 15:46:59, Zhenyao Mo wrote: > On 2016/09/10 04:50:17, vmiura wrote: > > On ...
4 years, 3 months ago (2016-09-12 04:23:01 UTC) #48
vmiura
On 2016/09/12 04:23:01, vmiura wrote: > On 2016/09/10 15:46:59, Zhenyao Mo wrote: > > On ...
4 years, 3 months ago (2016-09-12 04:27:12 UTC) #49
Zhenyao Mo
On 2016/09/12 04:27:12, vmiura wrote: > On 2016/09/12 04:23:01, vmiura wrote: > > On 2016/09/10 ...
4 years, 3 months ago (2016-09-12 21:39:42 UTC) #50
qiankun
4 years, 3 months ago (2016-09-13 00:25:25 UTC) #51
Message was sent while issue was closed.
On 2016/09/12 21:39:42, Zhenyao Mo wrote:
> On 2016/09/12 04:27:12, vmiura wrote:
> > On 2016/09/12 04:23:01, vmiura wrote:
> > > On 2016/09/10 15:46:59, Zhenyao Mo wrote:
> > > > On 2016/09/10 04:50:17, vmiura wrote:
> > > > > On 2016/09/09 20:05:23, Zhenyao Mo wrote:
> > > > > > On 2016/09/09 19:26:11, vmiura wrote:
> > > > > > > Can I confirm, are we clearing GL_PIXEL_UNPACK_BUFFER only in
> > > > > > > TextureManager::Initialize()?
> > > > > > > 
> > > > > > > If so, that will only be done on the 1st context in a
ContextGroup,
> > and
> > > > > > doesn't
> > > > > > > seem sufficient.  We should reset this state on all new contexts.
> > > > > > If I understand this correctly, we do reset it for new contexts at
> > > > > ContextState
> > > > > > level, but that's not early enough.  We only need to do this here
> > > > (duplicated
> > > > > > step) for creating black fallback textures.
> > > > > 
> > > > > I might be misunderstanding something that is initializing it, so
please
> > > bear
> > > > > with me.
> > > > > 
> > > > > We reset the state via:
> > > > > 
> > > > >   GLContext::MakeVirtuallyCurrent()
> > > > >    -> GLES2DecoderImpl::RestoreState()
> > > > >      -> ContextState::RestoreState()
> > > > >        -> ContextState::RestoreBufferBindings()
> > > > > 
> > > > > However, when a context is first created and made current, the Decoder
> is
> > > not
> > > > > initialized and the call to ContextState::RestoreState() is skipped.
> > > > > 
> > > > >  
> > > > >
> > > >
> > >
> >
>
https://cs.chromium.org/chromium/src/ui/gl/gl_context.cc?sq=package:chromium&...
> > > > > 
> > > > > This means the context may be in a bad state, until a future call to
> > > > > MakeVirtuallyCurrent.
> > > > 
> > > > You are absolutely right.  It's not just the PIXEL_UNPACK_BUFFER, all
> other
> > > > states could be incorrect and could make the black textures setup go
> wrong,
> > > for
> > > > example, the UNPACK_* parameters.
> > > > 
> > > > So the best solution is to find a way to call
> ContextState::RestoreState(). 
> > > If
> > > > that turns out to be too challenging, the next viable solution might be
> > delay
> > > > the black textures setup and do it on demand later.
> > > 
> > > Perhaps rather than move things up into ContextGroup::Initialize, we
should
> > > defer ContextGroup black textures initialization until the end of
> > > GLES2DecoderImpl::Initialize() for the 1st context in the ContextGroup.
> > 
> > lol.. sorry that's what you said at the end XP.  I think just deferring the
> > setup sounds like a better solution to me.  At the time ContextGroup is
> > initialized right now, we don't have a ContextState to restore.
> 
> It seems we agree on the same path forward.
> 
> Qiankun, are you willing to take a shot at this? I will be out of office in
the
> following a few days, but Victor can answer questions if you have any.

No problem. I can take a look at this.

Powered by Google App Engine
This is Rietveld 408576698