New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 688632 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocking:
issue 682753
issue angleproject:1895



Sign in to add a comment

max_color_attachments is incorrect on some native ES 3 contexts

Project Member Reported by kainino@chromium.org, Feb 4 2017

Issue description

max_color_attachments is supposed to be set here[1] but it isn't on some native ES 3.0 contexts because GL_EXT_draw_buffers is not available (which makes perfect sense).

The detection code just needs to be updated for GL_EXT_draw_buffers _or_ GL ES 3.

Specifically this is seen on the Google Pixel. EDIT: on the tests:
conformance2/state/gl-get-calls.html
conformance2/rendering/draw-buffers.html

[1] https://cs.chromium.org/chromium/src/gpu/command_buffer/service/context_group.cc?l=172&rcl=d3fea77d3946f173acb8305d6af5a77ec6762d40
 
Labels: -Pri-2 Pri-1
At least one of the affected tests is:
conformance2/state/gl-get-calls.html

It passes with this fix.

Comment 3 by zmo@chromium.org, Feb 6 2017

Nice!
Cc: kbr@chromium.org zmo@chromium.org oetu...@nvidia.com
zmo, kbr, or oetuaho:

Hm, I'm having trouble understanding whether I've done this correctly in https://codereview.chromium.org/2678483003 .

Based on what feature_info does, it seems like this should really be done there instead of in context_group. However the code in feature_info seems to be very explicit about not setting ext_draw_buffers=true on all ES3 contexts. As far as I can tell from the EXT_draw_buffers spec, it's supposed to be a subset of ES3 functionality ported back to ES2. Is that correct?

https://cs.chromium.org/chromium/src/gpu/command_buffer/service/feature_info.cc?l=1157&rcl=36239a44ed2dfc0e88b0c7d1e1d51b502ce5d9a0
Description: Show this description
> Hm, I'm having trouble understanding whether I've done this correctly

I definitely haven't. conformance2/rendering/draw-buffers.html fails (because validators_ isn't modified as it needs to be in feature_info).
See https://codereview.chromium.org/2678483003
for my proposed fix. It changes the logic quite a bit, but I'm pretty sure it's more correct.

Comment 8 by oetu...@nvidia.com, Feb 8 2017

I think there was a slight behavioral difference in color broadcasting between EXT_draw_buffers and core ES3 draw buffers that motivated the previous feature detection logic. Since the previous feature detection code was implemented, ANGLE has gotten a feature to emulate color broadcast in some cases (see angle/src/compiler/translator/EmulateGLFragColorBroadcast.cpp), and the WebGL extension spec has also changed (https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/) which probably warrants changing the feature detection code now. But just be careful to check that the color broadcast behavior is still working in the case where it's needed, I think that is when using the WEBGL_draw_buffers extension and a shader that enables EXT_draw_buffers.
Updated list of the tests affected by this:

deqp/data/gles3/shaders/constant_expressions.html
deqp/functional/gles3/fragmentoutput/*
deqp/functional/gles3/integerstatequery.html
deqp/functional/gles3/shadercommonfunction.html
conformance2/programs/gl-get-frag-data-location.html
conformance2/renderbuffers/readbuffer.html
conformance2/rendering/clear-func-buffer-type-match.html
conformance2/rendering/draw-buffers.html
conformance2/rendering/framebuffer-completeness-unaffected.html
conformance2/rendering/framebuffer-unsupported.html
conformance2/state/gl-get-calls.html
conformance2/state/gl-object-get-calls.html
Thanks Olli, your comment was very helpful. With it in mind, I looked carefully into all of the extension specifications, comments, and your old CL. I have a much better understanding now.
After talking with Mo, we decided we should be able to remove the emulation of ES2+EXT_draw_buffers on top of ES3+NV_draw_buffers, since code has been added for emulating it on top of vanilla ES3. I am trying that currently.
Project Member

Comment 12 by bugdroid1@chromium.org, Feb 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/252e09263e39d4e06b2a9dc094ea30ca140e0a4d

commit 252e09263e39d4e06b2a9dc094ea30ca140e0a4d
Author: kainino <kainino@chromium.org>
Date: Wed Feb 15 21:25:08 2017

Fix EXT_draw_buffers detection on some GL ES 3 contexts

This also disables ES2 EXT_draw_buffers emulation on top of ES3+NV_draw_buffers as it's not needed anymore - EXT_draw_buffers can now be emulated on vanilla ES3.

This is important on some native GL ES 3 contexts (e.g. Qualcomm on Google Pixel).

BUG= 688632 
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

Review-Url: https://codereview.chromium.org/2678483003
Cr-Commit-Position: refs/heads/master@{#450804}

[modify] https://crrev.com/252e09263e39d4e06b2a9dc094ea30ca140e0a4d/gpu/command_buffer/service/context_group.cc
[modify] https://crrev.com/252e09263e39d4e06b2a9dc094ea30ca140e0a4d/gpu/command_buffer/service/feature_info.cc
[modify] https://crrev.com/252e09263e39d4e06b2a9dc094ea30ca140e0a4d/gpu/command_buffer/service/feature_info.h
[modify] https://crrev.com/252e09263e39d4e06b2a9dc094ea30ca140e0a4d/gpu/command_buffer/service/feature_info_unittest.cc
[modify] https://crrev.com/252e09263e39d4e06b2a9dc094ea30ca140e0a4d/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/252e09263e39d4e06b2a9dc094ea30ca140e0a4d/gpu/command_buffer/service/test_helper.cc

Status: Fixed (was: Started)
Blocking: angleproject:1895
Project Member

Comment 15 by bugdroid1@chromium.org, Feb 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71

commit 81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71
Author: kainino <kainino@chromium.org>
Date: Thu Feb 16 00:50:10 2017

Revert of Fix EXT_draw_buffers detection on some GL ES 3 contexts (patchset #10 id:180001 of https://codereview.chromium.org/2678483003/ )

Reason for revert:
Failures on waterfall almost certainly due to this CL

Original issue's description:
> Fix EXT_draw_buffers detection on some GL ES 3 contexts
>
> This also disables ES2 EXT_draw_buffers emulation on top of ES3+NV_draw_buffers as it's not needed anymore - EXT_draw_buffers can now be emulated on vanilla ES3.
>
> This is important on some native GL ES 3 contexts (e.g. Qualcomm on Google Pixel).
>
> BUG= 688632 
> 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
>
> Review-Url: https://codereview.chromium.org/2678483003
> Cr-Commit-Position: refs/heads/master@{#450804}
> Committed: https://chromium.googlesource.com/chromium/src/+/252e09263e39d4e06b2a9dc094ea30ca140e0a4d

TBR=zmo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 688632 

Review-Url: https://codereview.chromium.org/2696333002
Cr-Commit-Position: refs/heads/master@{#450846}

[modify] https://crrev.com/81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71/gpu/command_buffer/service/context_group.cc
[modify] https://crrev.com/81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71/gpu/command_buffer/service/feature_info.cc
[modify] https://crrev.com/81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71/gpu/command_buffer/service/feature_info.h
[modify] https://crrev.com/81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71/gpu/command_buffer/service/feature_info_unittest.cc
[modify] https://crrev.com/81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/81ee0eb7c58ddf35cce08886ab5a6d4fc4303b71/gpu/command_buffer/service/test_helper.cc

Status: Started (was: Fixed)
Project Member

Comment 17 by bugdroid1@chromium.org, Feb 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/313016af0d837cfcc8ee3ccd19145f46eebc0b10

commit 313016af0d837cfcc8ee3ccd19145f46eebc0b10
Author: kainino <kainino@chromium.org>
Date: Fri Feb 17 19:55:22 2017

Fix EXT_draw_buffers detection on some GL ES 3 contexts

This also disables ES2 EXT_draw_buffers emulation on top of ES3+NV_draw_buffers as it's not needed anymore - EXT_draw_buffers can now be emulated on vanilla ES3.

This is important on some native GL ES 3 contexts (e.g. Qualcomm on Google Pixel).

BUG= 688632 
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

Review-Url: https://codereview.chromium.org/2678483003
Cr-Original-Commit-Position: refs/heads/master@{#450804}
Committed: https://chromium.googlesource.com/chromium/src/+/252e09263e39d4e06b2a9dc094ea30ca140e0a4d
Review-Url: https://codereview.chromium.org/2678483003
Cr-Commit-Position: refs/heads/master@{#451360}

[modify] https://crrev.com/313016af0d837cfcc8ee3ccd19145f46eebc0b10/gpu/command_buffer/service/context_group.cc
[modify] https://crrev.com/313016af0d837cfcc8ee3ccd19145f46eebc0b10/gpu/command_buffer/service/feature_info.cc
[modify] https://crrev.com/313016af0d837cfcc8ee3ccd19145f46eebc0b10/gpu/command_buffer/service/feature_info_unittest.cc
[modify] https://crrev.com/313016af0d837cfcc8ee3ccd19145f46eebc0b10/gpu/command_buffer/service/test_helper.cc

Status: Fixed (was: Started)
> This also disables ES2 EXT_draw_buffers emulation on top of ES3+NV_draw_buffers as it's not needed anymore - EXT_draw_buffers can now be emulated on vanilla ES3.

Oops, this part of the commit message is wrong. I forgot to update the description.

Comment 19 by kbr@chromium.org, Feb 17 2017

To clarify (to the best of my understanding):

 - ES2's EXT_draw_buffers emulation is still supported on top of ES3+NV_draw_buffers. This is done because only NV_draw_buffers allows gl_FragData[i] (where i > 0) to be written in ESSL 1.00 shaders.

 - There is no emulation of EXT_draw_buffers when hosted on top of pure ES3 contexts (without NV_draw_buffers). In this case, only ESSL 3.00 shaders are allowed to access additional draw buffers beyond the 0th one.

 - EXT_draw_buffers is still supported on top of the desktop OpenGL Core Profile.

Thanks Kai for carrying through this fix.

That's correct. This change to the feature detection logic is intended to clarify the logic but shouldn't affect the availability of EXT_draw_buffers at all. Overall the patch should only fix MAX_COLOR_ATTACHMENTS and MAX_DRAW_BUFFERS on ES3/WebGL2.
Components: -Internals>GPU>WebGL Blink>WebGL

Sign in to add a comment