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

Issue 1700433002: Complete disable_gl_rgb_format workaround for Mali-400 GPU (Closed)

Created:
4 years, 10 months ago by halliwell
Modified:
4 years, 6 months ago
CC:
chromium-reviews, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Complete disable_gl_rgb_format workaround for Mali-400 GPU GL_RGB format is not supported on Mali-400; this change made a start on a workaround for it: https://codereview.chromium.org/996163003 However, a number of things were not handled correctly, for example the alpha channel could be cleared to 0, making content not show up on screen. BUG=449150 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel

Patch Set 1 #

Total comments: 12

Patch Set 2 : Logic fixes from PS1 review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -10 lines) Patch
M gpu/command_buffer/service/context_state.h View 3 chunks +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/context_state.cc View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/service/framebuffer_manager.h View 1 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/framebuffer_manager.cc View 1 1 chunk +9 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 4 chunks +23 lines, -7 lines 0 comments Download

Messages

Total messages: 14 (3 generated)
halliwell
This is a first pass based on discussion with Brandon this morning. I'm super tight ...
4 years, 10 months ago (2016-02-12 20:43:12 UTC) #4
Zhenyao Mo
https://codereview.chromium.org/1700433002/diff/1/gpu/command_buffer/service/framebuffer_manager.cc File gpu/command_buffer/service/framebuffer_manager.cc (right): https://codereview.chromium.org/1700433002/diff/1/gpu/command_buffer/service/framebuffer_manager.cc#newcode475 gpu/command_buffer/service/framebuffer_manager.cc:475: GLenum Framebuffer::GetColorAttachmentFormat() const { Name this GetColorAttachment0Format. https://codereview.chromium.org/1700433002/diff/1/gpu/command_buffer/service/gles2_cmd_decoder.cc File ...
4 years, 10 months ago (2016-02-12 21:06:06 UTC) #5
bajones
Looks good, but needs two fixes. https://codereview.chromium.org/1700433002/diff/1/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/1700433002/diff/1/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode2759 gpu/command_buffer/service/gles2_cmd_decoder.cc:2759: if (workarounds().disable_gl_rgb_format) { ...
4 years, 10 months ago (2016-02-12 21:07:41 UTC) #6
halliwell
Thank you both for the rapid feedback. Planning to submit PS2 in our local branch ...
4 years, 10 months ago (2016-02-12 22:52:56 UTC) #7
Ken Russell (switch to Gerrit)
I don't understand how this fix works, since it mainly seems to affect the behavior ...
4 years, 10 months ago (2016-02-17 19:59:09 UTC) #8
Zhenyao Mo
On 2016/02/17 19:59:09, Ken Russell wrote: > I don't understand how this fix works, since ...
4 years, 10 months ago (2016-02-17 20:51:49 UTC) #9
Ken Russell (switch to Gerrit)
On 2016/02/17 20:51:49, Zhenyao Mo wrote: > On 2016/02/17 19:59:09, Ken Russell wrote: > > ...
4 years, 10 months ago (2016-02-17 22:33:33 UTC) #10
halliwell
On 2016/02/17 22:33:33, Ken Russell wrote: > On 2016/02/17 20:51:49, Zhenyao Mo wrote: > > ...
4 years, 9 months ago (2016-03-02 23:49:51 UTC) #11
Zhenyao Mo
On 2016/03/02 23:49:51, halliwell wrote: > On 2016/02/17 22:33:33, Ken Russell wrote: > > On ...
4 years, 9 months ago (2016-03-03 23:48:21 UTC) #12
Ken Russell (switch to Gerrit)
On 2016/03/03 23:48:21, Zhenyao Mo wrote: > On 2016/03/02 23:49:51, halliwell wrote: > > On ...
4 years, 9 months ago (2016-03-03 23:57:06 UTC) #13
halliwell
4 years, 9 months ago (2016-03-04 03:17:18 UTC) #14
On 2016/03/03 23:57:06, Ken Russell wrote:
> On 2016/03/03 23:48:21, Zhenyao Mo wrote:
> > On 2016/03/02 23:49:51, halliwell wrote:
> > > On 2016/02/17 22:33:33, Ken Russell wrote:
> > > > On 2016/02/17 20:51:49, Zhenyao Mo wrote:
> > > > > On 2016/02/17 19:59:09, Ken Russell wrote:
> > > > > > I don't understand how this fix works, since it mainly seems to
affect
> > the
> > > > > > behavior of the command buffer's "default" back buffer, which is no
> > longer
> > > > > used
> > > > > > by WebGL. Instead, WebGL's back buffer is managed in Blink's
> > DrawingBuffer
> > > > > > class. Perhaps it's still getting some of its parameters from the
> > default
> > > > back
> > > > > > buffer via GL queries.
> > > > > > 
> > > > > > If it works, then the current code basically LGTM, though I defer
> review
> > > to
> > > > > > Brandon and Mo.
> > > > > 
> > > > > Yes, most code deals with back buffer.  It is still nice to have, to
> make
> > > this
> > > > > emulation complete.
> > > > > 
> > > > > The part that fixed the bug is line 6156 - 6163 in
gles2_cmd_decoder.cc
> > > > 
> > > > Got it. Thanks.
> > > 
> > > I was trying to write a test for this - I had hoped we could force-enable
> the
> > > workaround on any GPU to test.  But now I realised the behaviour is
specific
> > to
> > > this GPU.  I've established that the driver allows you to create RGB
> textures,
> > > but actually backs them with RGBA storage.  If you bind the texture to a
> > > framebuffer, you can render into the alpha channel, and then you can read
> that
> > > alpha channel back in a shader later.  I wrote a standalone test program
to
> > show
> > > this happening in isolation.
> > > 
> > > That's what was happening here: DrawingBuffer allocates RGB texture, it's
> > bound
> > > to a framebuffer, ClearUnclearedAttachments cleared alpha to 0, and later
> the
> > > compositor read the alpha channel in its shader.
> > > 
> > > Based on this behaviour, I'd love to hear your thoughts on what else may
be
> > > needed for correctness of the workaround.  It seems like it will be hard
to
> > test
> > > on a regular GPU, unless we go further and implement the 'back with RGBA
> > > texture' part on the Chromium side instead of relying on whatever the
driver
> > is
> > > doing here.
> > > 
> > > Thoughts?
> > 
> > I agree it's not easy to test on a GPU without this issue. The easiest is to
> run
> > WebGL conformance on the affected hardware.
> 
> I'm not 100% sure, but I think the best solution to this problem would be to
> teach the DrawingBuffer.cpp code in Blink about the need to stop using the
> GL_RGB format in DrawingBuffer::defaultTextureParameters. Not sure how to
> communicate that from the embedder -- maybe via WebGraphicsInfo in
> WebGraphicsContext3D.h. Then DrawingBuffer can ensure that the alpha channel
is
> cleared to 1 before handing it off to the compositor. To be honest I don't
> understand why this patch works.

I put something on your calendars for next week so we could talk the rest of
this through :)

Powered by Google App Engine
This is Rietveld 408576698