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

Issue 772651 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Compat

Blocking:
issue 662644


Participants' hotlists:
webgl-conformance-all


Sign in to add a comment

GLSL bug: some vector op in loop miss .yzw

Reported by fabrice....@gmail.com, Oct 7 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Example URL:
https://www.shadertoy.com/view/llSXDd

Steps to reproduce the problem:
an example of faulty GLSL program:
    o = vec4(0);
    for (int i=0; i<2; i++) {
      o += 2.*gl_FragCoord.x;
   }
gl_FragColor = o;

see many not working or working variants at https://www.shadertoy.com/view/llSXDd

What is the expected behavior?
white screen

What went wrong?
red screen

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? No
 firefox/linux

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 14.04
Flash Version: Shockwave Flash 27.0 r0

- seems correct on windows/angle and wrong in linux/openGL
- still there 2 years after discovery
  so, on Version 61.0.3163.100 and older
 
Components: Blink>WebGL Internals>GPU
Cc: ranjitkan@chromium.org
Labels: Needs-Feedback
Could you please the attached image and confirm if this is the expected, Seeing the same behavior on Windows, Mac and Ubuntu 14.04 for chrome version 61.0.3163.100.
White.png
235 KB View Download

Comment 3 by zmo@chromium.org, Oct 9 2017

Cc: kbr@chromium.org kainino@chromium.org
Labels: -Needs-Feedback -Via-Wizard-Content GPU-NVidia
Owner: oetu...@nvidia.com
Status: Assigned (was: Unconfirmed)
I can reproduce it on Linux/NVidia, but not Mac/AMD or Windows/NVidia/D3D, or Android/Qualcomm.

I can also reproduce it on Windows/NVidia/GL with --use-angle=gl.

I suspect this is a NVidia OpenGL driver bug. I will also test on NVidia's ES3 driver when I get back home.

Olli: assigning it to you to take a look.
ranjitkan@chromium.org : yes, this is the expected behavior. 
it shows in red when it's faulty. 

Comment 5 by oetu...@nvidia.com, Oct 11 2017

Here's a minimal GLSL ES shader to reproduce the issue:

#version 300 es

precision highp float;

out vec4 my_FragColor;

void main()
{
    my_FragColor = vec4(0);
    for (int i = 0; i < 2; i++) {
        my_FragColor += 2.0 * gl_FragCoord.x;
    }
}

A bug has been filed against the NVIDIA GL driver team.

Comment 6 by zmo@chromium.org, Oct 11 2017

Thank you, Olli! Can you add this shader to conformance suite?

Comment 7 by oetu...@nvidia.com, Oct 12 2017

Here's a conformance test: https://github.com/KhronosGroup/WebGL/pull/2529

We could also consider a workaround in ANGLE's shader translator. I'd imagine we could make this work in the broken drivers by changing scalar parameters of vector/scalar ops to vectors:

vec4 a = vec4(0.0);
a += 2.0 * scalar;

into

vec4 a = vec4(0.0);
a += vec4(2.0) * vec4(scalar);

It might be quite a bit of work to get a complete workaround in place though. It's not enough to simply construct vectors from scalar parameters to vector/scalar ops, but whenever there's a scalar op inside a vector constructor the parameters of that would need to be made into vectors.
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/angle/angle/+/661fc487dd556531367f89eb108ed850b8fbe59a

commit 661fc487dd556531367f89eb108ed850b8fbe59a
Author: Olli Etuaho <oetuaho@nvidia.com>
Date: Thu Nov 09 18:16:56 2017

Work around NVIDIA GLSL vector-scalar op bug

This adds a new AST transform VectorizeVectorScalarArithmetic. The AST
transform works around incorrect handling of certain types of GLSL
arithmetic operations by NVIDIA's GL driver. It works around only the
most common cases where the bug reproduces, since detecting all the
cases would take more sophisticated analysis of the code than what
is currently easily implementable in ANGLE.

When a float add operator has both vector and scalar operands, the AST
transform turns the scalar operand into a vector operand. Example:

vec4 f;
f += 1.0;

gets turned into:

vec4 f;
f += vec4(1.0);

When a vector constructor contains a binary scalar float
multiplication or division operation as its only argument, the AST
transform turns both operands of the binary operation into vector
operands. Example:

float f, g;
vec4(f * g);

gets turned into:

float f, g;
vec4(vec4(f) * vec4(g));

Another example with compound assignment:

float f, g;
vec4(f *= g);

gets turned into:

float f, g;
vec4 s0 = vec4(f);
(s0 *= g, f = s0.x), s0;

This latter transformation only works in case the compound assignment
left hand expression doesn't have side effects.

BUG=chromium:772651
TEST=angle_end2end_tests

Change-Id: I84ec04287793c56a94845a725785439565debdaf
Reviewed-on: https://chromium-review.googlesource.com/721321
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>

[modify] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/include/GLSLANG/ShaderLang.h
[modify] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/compiler/translator/Compiler.cpp
[modify] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/tests/gl_tests/GLSLTest.cpp
[modify] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/libANGLE/renderer/gl/ShaderGL.cpp
[add] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp
[modify] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/libANGLE/renderer/gl/renderergl_utils.cpp
[modify] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/compiler.gypi
[modify] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/libANGLE/renderer/gl/WorkaroundsGL.h
[add] https://crrev.com/661fc487dd556531367f89eb108ed850b8fbe59a/src/compiler/translator/VectorizeVectorScalarArithmetic.h

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/db042788df1a3487e2cefbe0eb70d6d09983793f

commit db042788df1a3487e2cefbe0eb70d6d09983793f
Author: angle-deps-roller@chromium.org <angle-deps-roller@chromium.org>
Date: Thu Nov 09 19:46:05 2017

Roll skia/third_party/externals/angle2/ 73dcc60c8..661fc487d (1 commit)

https://chromium.googlesource.com/angle/angle.git/+log/73dcc60c868f..661fc487dd55

$ git log 73dcc60c8..661fc487d --date=short --no-merges --format='%ad %ae %s'
2017-10-16 oetuaho Work around NVIDIA GLSL vector-scalar op bug

Created with:
  roll-dep skia/third_party/externals/angle2
BUG=772651


The AutoRoll server is located here: https://angle-skia-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.


CQ_INCLUDE_TRYBOTS=skia.primary:Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE,Perf-Win10-MSVC-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE,Perf-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE,Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE,Perf-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE,Perf-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE,Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE,Test-Win10-MSVC-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE,Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE,Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE,Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE,Test-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE,Build-Debian9-GCC-x86_64-Release-ANGLE
TBR=egdaniel@google.com

Change-Id: Ibe480b0bdd2abfd3f3799452022b05bb281d9644
Reviewed-on: https://skia-review.googlesource.com/69521
Reviewed-by: angle-deps-roller . <angle-deps-roller@chromium.org>
Commit-Queue: angle-deps-roller . <angle-deps-roller@chromium.org>

[modify] https://crrev.com/db042788df1a3487e2cefbe0eb70d6d09983793f/DEPS

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 10 2017

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

commit db357083235b85f6f7e707e872d90a669c14d545
Author: angle-deps-roller@chromium.org <angle-deps-roller@chromium.org>
Date: Fri Nov 10 00:19:28 2017

Roll src/third_party/angle/ 73dcc60c8..9e888a46f (3 commits)

https://chromium.googlesource.com/angle/angle.git/+log/73dcc60c868f..9e888a46f04d

$ git log 73dcc60c8..9e888a46f --date=short --no-merges --format='%ad %ae %s'
2017-11-06 jgilbert Fix HALF_FLOAT/HALF_FLOAT_OES selection with the ES3 backend.
2017-11-06 jgilbert Set TextureGL dirty bits when workaround usage of levels changes.
2017-10-16 oetuaho Work around NVIDIA GLSL vector-scalar op bug

Created with:
  roll-dep src/third_party/angle
BUG=772651


The AutoRoll server is located here: https://angle-chromium-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.


CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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
TBR=geofflang@chromium.org

Change-Id: I0ab39fee7818f6f76b30fa7e730a0d98dbd5d8bd
Reviewed-on: https://chromium-review.googlesource.com/761238
Reviewed-by: angle-deps-roller . <angle-deps-roller@chromium.org>
Commit-Queue: angle-deps-roller . <angle-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515364}
[modify] https://crrev.com/db357083235b85f6f7e707e872d90a669c14d545/DEPS

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 10 2017

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

commit 4e71fb3a775baa675546516403080094d2628d92
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Fri Nov 10 01:54:41 2017

Roll src/third_party/skia/ 0d8766c84..22499b096 (19 commits)

https://skia.googlesource.com/skia.git/+log/0d8766c84c80..22499b0969ac

$ git log 0d8766c84..22499b096 --date=short --no-merges --format='%ad %ae %s'
2017-11-09 bungeman Update mirror-dev for *-dev:amd64 packages.
2017-11-09 herb Revert "Gauss filter calculation"
2017-11-09 reed Revert "Revert "Remove MakeForLocalSpace since picture image is sufficient""
2017-11-09 brianosman Include target CS in SkColorSpaceXformCanvas' image info
2017-11-09 caryclark replace some points with vectors to clarify documentation
2017-11-09 jvanverth Move ms meter from the title bar to the display
2017-11-09 egdaniel Dynamically load the vulkan library in our test tools
2017-11-09 ethannicholas renamed GrPrimitiveEdgeType / GrProcessorEdgeType to GrClipEdgeType
2017-11-09 halcanary SkTypeface_win_dw, SkTypeface_Mac: set NotEmbeddable_FontFlag
2017-11-09 angle-deps-roller Roll skia/third_party/externals/angle2/ 661fc487d..9e888a46f (2 commits)
2017-11-03 herb Gauss filter calculation
2017-11-09 angle-deps-roller Roll skia/third_party/externals/angle2/ 73dcc60c8..661fc487d (1 commit)
2017-11-09 kjlubick Use validating buffer for skpath
2017-11-09 reed Revert "Remove MakeForLocalSpace since picture image is sufficient"
2017-11-09 mtklein remove SkFixedMul_arm()
2017-11-09 bungeman Update doc and example for SkPaint::FontMetrics.
2017-11-09 benjaminwagner Guard VFPv3 ASM with an ifdef.
2017-11-09 ahaas [v8-platform] Store the platform in a unique_ptr
2017-11-09 angle-deps-roller Roll skia/third_party/externals/angle2/ 70b715c9b..73dcc60c8 (3 commits)

Created with:
  roll-dep src/third_party/skia
BUG=772651, 781164 


The AutoRoll server is located here: https://autoroll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;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
TBR=egdaniel@chromium.org

Change-Id: I2244a33b3cab5564b38e5fb69ae58a5ad87e6f35
Reviewed-on: https://chromium-review.googlesource.com/762400
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515414}
[modify] https://crrev.com/4e71fb3a775baa675546516403080094d2628d92/DEPS

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 14 2017

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

commit 09a81d3609c63f62d4775e087cbefdd7468da170
Author: Kenneth Russell <kbr@chromium.org>
Date: Tue Nov 14 06:54:56 2017

Roll WebGL 34842fa..12192b9

https://chromium.googlesource.com/external/khronosgroup/webgl.git/+log/34842fa..12192b9

BUG= 765469 ,  768969 ,  769989 , 772651

TEST=bots

TBR=zmo@chromium.org, kainino@chromium.org

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;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
Change-Id: I180314943cb6427b916790f5ae5bf295c87330ea
Reviewed-on: https://chromium-review.googlesource.com/764818
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516218}
[modify] https://crrev.com/09a81d3609c63f62d4775e087cbefdd7468da170/DEPS
[modify] https://crrev.com/09a81d3609c63f62d4775e087cbefdd7468da170/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
[modify] https://crrev.com/09a81d3609c63f62d4775e087cbefdd7468da170/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
[modify] https://crrev.com/09a81d3609c63f62d4775e087cbefdd7468da170/content/test/gpu/gpu_tests/webgl_conformance_revision.txt

does this mean it should be fixed ? 
the shader still appears red in 62.0.3202.94 

Comment 14 by oetu...@nvidia.com, Nov 27 2017

Owner: zmo@chromium.org
Status: Started (was: Assigned)
The most common manifestations of the bug are fixed in the development branch. The change is in Chrome Canary 64.0.3278.0, and will be shipped in stable version 64 as well. NVIDIA driver update is also upcoming.

@zmo Do you think that the workaround could or should be merged to earlier versions of Chromium? The slightly tricky thing is that even though the core of the ANGLE patch is simple, it does touch some tests etc. that could require some manual work when merging.

Comment 15 by zmo@chromium.org, Nov 28 2017

Cc: zmo@chromium.org
Owner: oetu...@nvidia.com
Status: Fixed (was: Started)
I don't think we need to merge this back because it's a corner case and not a security concern and apps can easily work around this bug on their side.

Mark this as Fixed and give back ownership to Olli.
Project Member

Comment 16 by bugdroid1@chromium.org, Nov 13

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

commit 539ef7dd7cb70fc0fa684c44c0bfce18ced47e61
Author: Corentin Wallez <cwallez@chromium.org>
Date: Tue Nov 13 17:08:12 2018

Add back some WebGL test expectations

A lot of expectations were removed but some of them were still
necessary, this adds them back.

TBR=kbr@chromium.org
BUG= chromium:693135 
BUG=chromium:772651
BUG= chromium:798117 
BUG= chromium:874620 
BUG=chromium:887241

Change-Id: Ib3bccdf2ff48a28a8f0a3ce428239980a58c5266
Reviewed-on: https://chromium-review.googlesource.com/c/1333650
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607626}
[modify] https://crrev.com/539ef7dd7cb70fc0fa684c44c0bfce18ced47e61/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
[modify] https://crrev.com/539ef7dd7cb70fc0fa684c44c0bfce18ced47e61/content/test/gpu/gpu_tests/webgl_conformance_expectations.py

Owner: ----
Status: Available (was: Fixed)
This test is still failing on Android. We'll need to fix it for conformance.
Blocking: 662644
Labels: webgl-conformance
Cc: jhelfe...@nvidia.com
Adding James Helferty (jhelferty@nvidia.com) to CC for WebGL conformance issues on Nvidia GPUs.
This is nvidia bug number 2003466.

Comment 22 by jdarpinian@chromium.org, Jan 16 (6 days ago)

Labels: -OS-Linux OS-Android
Owner: jdarpinian@chromium.org
Status: Assigned (was: Available)

Comment 23 by kkinnu...@nvidia.com, Jan 17 (6 days ago)

This has been fixed late 2017 and merged to branches since as part of standard release process. Unfortunately specifics of the process wrt release numbers isn't yet available.

This particular bug cannot be observed in currently available public windows drivers, including the smallest number 390.77.

For Android, concerning this specific version:
Shield TV version: 7.2.2(30.7.130.7) (Shield TV upgrade 7.2)
OpenGL version: 415.00 (Note: this number in general does not have any relation to any other platform, including other NV Android releases.)
Android version: 8.0.0
Security patch version: Nov-05 2018
Build: OPR6.170323.0103664093_1378.1894


https://www.shadertoy.com/view/llSXDd
https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop.html

The testcases passes on this build, but I could not verify if it's because of the workaround or the driver fix.


For workaround filters, I could offer conservative:
Windows: if (gl_version > 400.00)
Linux: if (gl_version > 400.00)
Android: if (is_shield_tv() && shield_tv_version() >= 7.2.2)

(I know that is_shield_tv() is a bit problematic)


Sign in to add a comment