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

Issue 772695 link

Starred by 1 user

Issue metadata

Status: ExternalDependency
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-05-16
OS: Windows
Pri: 2
Type: Bug


Sign in to add a comment

GLSL bug: switch() miss inside returns

Reported by fabrice....@gmail.com, Oct 8 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/XsjczG

Steps to reproduce the problem:
some switch() for which a case ends via a return.
see https://www.shadertoy.com/view/XsjczG

What is the expected behavior?
return when statement return is reached.

What went wrong?
on (some?) windows/Angle, ignore the return in switch.
(see users comments in the link).

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 
Flash Version: 

I think I also saw it happened for some return in if.
Looks like a bad management of return in divergence situation.

One of the users is on Win10pro / Chrome, another got it on firefox+chrome in windows 8.
 
how can I add tags Components: Blink>WebGL , Internals>GPU in this interface ?
Labels: Needs-Triage-M61
Components: -Blink Blink>WebGL

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

Cc: kbr@chromium.org geoffl...@chromium.org kainino@chromium.org cwallez@chromium.org jmad...@chromium.org
Components: Internals>GPU>ANGLE
Labels: -Via-Wizard-Content -Needs-Triage-M61
Owner: oetu...@nvidia.com
Status: Assigned (was: Unconfirmed)
I can reproduce this on Windows (NVidia). On my Mac/Linux, it works fine. Also, on Windows with --use-angle=gl, it also works fine.

I suspect a bug in ANGLE's HLSL compiler backend.

Olli: will you be able to take a look at this? If not, please assign back to me.

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

There are at least a few issues in compiling switch statements to HLSL in ANGLE. I'll work on fixing them. The underlying cause for this bug might be in the native HLSL compiler though.

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

Thanks Olli. If it turns out to be HLSL compiler bug, then let's file an issue to Microsoft. Or if it's semantic difference between HLSL and GLSL, then we need to work around it.

Comment 8 by oetu...@nvidia.com, Oct 10 2017

Here's something approaching a minimal test case, meant for ANGLE's GLSLTest.cpp.
test-switch-in-loop.cpp
927 bytes View Download
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 12 2017

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

commit 4bd730c8c1a97a3229cfbb9f1dfa79efef696210
Author: Olli Etuaho <oetuaho@nvidia.com>
Date: Thu Oct 12 16:57:48 2017

Recognize more non-fallthrough cases in switch/case

RemoveSwitchFallThrough now treats cases where break; or return; is
nested inside a block as non-fallthrough to avoid unnecessary
duplication of code. For example, the case 1 below would previously
get treated as fall-through:

switch(foo)
{
    case 1:
    {
        break;
    }
    default:
        break;
}

Now RemoveSwitchFallThrough doesn't do anything to this code.

BUG=chromium:772695
TEST=angle_end2end_tests

Change-Id: Iafab6d8b05c63bcdb5f54834dbc1f41192c31dd4
Reviewed-on: https://chromium-review.googlesource.com/709197
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>

[modify] https://crrev.com/4bd730c8c1a97a3229cfbb9f1dfa79efef696210/src/tests/gl_tests/GLSLTest.cpp
[modify] https://crrev.com/4bd730c8c1a97a3229cfbb9f1dfa79efef696210/src/compiler/translator/RemoveSwitchFallThrough.cpp

Project Member

Comment 10 by bugdroid1@chromium.org, Oct 12 2017

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

commit 5bd9f2c19ea5f2e893ba7aeebef9e3c217f084bb
Author: angle-deps-roller@chromium.org <angle-deps-roller@chromium.org>
Date: Thu Oct 12 19:19:31 2017

Roll skia/third_party/externals/angle2/ 6aee8620c..c3bc98415 (2 commits)

https://chromium.googlesource.com/angle/angle.git/+log/6aee8620c51f..c3bc98415696

$ git log 6aee8620c..c3bc98415 --date=short --no-merges --format='%ad %ae %s'
2017-10-11 cwallez WebGLCompatibility: test for vertex OOB caused by indices
2017-10-10 oetuaho Recognize more non-fallthrough cases in switch/case

Created with:
  roll-dep skia/third_party/externals/angle2
BUG=602688,772695


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

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


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

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

[modify] https://crrev.com/5bd9f2c19ea5f2e893ba7aeebef9e3c217f084bb/DEPS

Project Member

Comment 11 by bugdroid1@chromium.org, Oct 12 2017

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

commit 2fba1215cdc4fb726f8412970e47ca7f632c9156
Author: Frank Henigman <fjhenigman@chromium.org>
Date: Thu Oct 12 22:55:36 2017

Roll ANGLE 852fe87..c3bc984

https://chromium.googlesource.com/angle/angle.git/+log/852fe87..c3bc984

BUG=chromium:772695,602688

TEST=bots

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

Change-Id: I5cd6ab1e70fe4510b1d13e71b7d04a24a86e40b7
Reviewed-on: https://chromium-review.googlesource.com/716858
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508517}
[modify] https://crrev.com/2fba1215cdc4fb726f8412970e47ca7f632c9156/DEPS

Project Member

Comment 12 by bugdroid1@chromium.org, Oct 13 2017

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

commit 1a24eadedcaf0ccdaac8648c812dffad37b9fce5
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Fri Oct 13 22:15:45 2017

Roll src/third_party/skia/ e60ca7eae..f543a60ef (46 commits; 2 trivial rolls)

https://skia.googlesource.com/skia.git/+log/e60ca7eae432..f543a60ef06a

$ git log e60ca7eae..f543a60ef --date=short --no-merges --format='%ad %ae %s'
2017-10-13 fmalita [SVGDom] Add 'stroke-dasharray' support
2017-10-13 angle-deps-roller Roll skia/third_party/externals/angle2/ 40dbdd6c7..2bdbf788b (1 commit)
2017-10-13 abarth Add the ability to customize skia's settings in gn
2017-10-13 kjlubick Fix asset version detection
2017-10-13 bsalomon Implemenet onStealBackendTexture in GrMtlTexture
2017-10-13 reed remove dead code -- older than min picture version
2017-10-13 angle-deps-roller Roll skia/third_party/externals/angle2/ 3755c48d1..40dbdd6c7 (1 commit)
2017-10-13 halcanary platform_tools/android/bin/android_gdbserver: fix error
2017-10-12 bungeman Make SkTypeface::Style and FromOldStyle private.
2017-10-09 egdaniel Add support for allocating mips inside of ColorSpaceXormImageGenerator
2017-10-11 benjaminwagner Add Win Clang ANGLE test and perf jobs.
2017-10-13 angle-deps-roller Roll skia/third_party/externals/angle2/ 429756442..3755c48d1 (1 commit)
2017-10-13 reed remove dead code for getSize, getSafeSize, etc.
2017-10-13 mtklein Back out new SkColorSpaceXform pipeline.
2017-10-13 reed Revert "move SkMatrix anonymous affine enum to private"
2017-10-13 kjlubick Modify skpbench to use newer adb version
2017-10-13 kjlubick Adjust blacklist for IB2
2017-10-13 angle-deps-roller Roll skia/third_party/externals/angle2/ 41200d21b..429756442 (1 commit)
2017-10-13 angle-deps-roller Roll skia/third_party/externals/angle2/ 91c8de883..41200d21b (1 commit)
2017-10-13 angle-deps-roller Roll skia/third_party/externals/angle2/ 22d7f1f3f..91c8de883 (1 commit)
2017-10-12 angle-deps-roller Roll skia/third_party/externals/angle2/ f6d242edb..22d7f1f3f (1 commit)
2017-10-12 angle-deps-roller Roll skia/third_party/externals/angle2/ c3bc98415..f6d242edb (1 commit)
2017-10-12 ericrk MakeBackendTextureFromSkImage
2017-10-12 caryclark move SkMatrix anonymous affine enum to private
2017-10-12 egdaniel Handle coverage for hairline lines with sub pixel lengths correctly on GPU
2017-10-12 reed remove dead flag
2017-10-12 angle-deps-roller Roll skia/third_party/externals/angle2/ 6aee8620c..c3bc98415 (2 commits)
2017-10-12 kjlubick Fix Chromebook output step and skpbench
2017-10-12 angle-deps-roller Roll skia/third_party/externals/angle2/ d736cccf0..6aee8620c (1 commit)
2017-10-11 mtklein check unpremul scale directly against infinity
2017-10-12 kjlubick Update to adb 1.0.35
2017-10-12 fmalita [SVGDom] Add 'visibility' support
2017-10-12 egdaniel Add flag on GrBackendTexture to say whether texture is mipped or not
2017-10-12 egdaniel Fix Metal build
2017-10-12 angle-deps-roller Roll skia/third_party/externals/angle2/ 923ecef6b..d736cccf0 (2 commits)
2017-10-12 egdaniel Use enum to track MipMapsStatus throughout Texture creation
2017-10-12 angle-deps-roller Roll skia/third_party/externals/angle2/ d92e93b8c..923ecef6b (1 commit)
2017-10-12 jvanverth Fix assert in GrSmallPathRenderer tickled by GLProgramsTest
2017-10-12 fmalita Plumb more SkPaintFilterCanvas virtuals
2017-10-11 mtklein abort SkRRect::transform() before dst->scaleRadii() asserts
2017-10-12 hcm Update Skia milestone to 64
2017-10-12 stani Implement getGrContext in SkPaintFilterCanvas
2017-10-12 jvanverth Batch better in GrSmallPathRenderer and add perspective support.
2017-10-11 robertphillips Force all Intel GPUs to use draws instead of clears on Macs

Created with:
  roll-dep src/third_party/skia
BUG= 602737 ,602688,772695


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

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


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

Change-Id: I5195a5c74f49f8b9f8830dcbf373e97f0f9ed63d
Reviewed-on: https://chromium-review.googlesource.com/719419
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@{#508840}
[modify] https://crrev.com/1a24eadedcaf0ccdaac8648c812dffad37b9fce5/DEPS

Comment 13 by oetu...@nvidia.com, Oct 17 2017

The remaining issue in the native HLSL compiler has been reported to Microsoft (contact person Rafael Cintron).

Comment 14 by zmo@chromium.org, Oct 17 2017

Thank you Olli.

Is this a bug in HLSL compiler in NVidia or in general?

Comment 15 by oetu...@nvidia.com, Oct 17 2017

The test fails on Intel GPU as well, which gives strong reason to suspect a general HLSL bug.
Owner: ----
Status: ExternalDependency (was: Assigned)
Marking as ExternalDependency, a workaround for the HLSL issue doesn't seem very feasible so this is not on my plate anymore.
The Microsoft HLSL compiler team has fixed this bug. The fix is on track to ship in the next release of Windows and a future version of the Windows SDK.
NextAction: 2018-04-16
Excellent, Rafael. I'll mark this as NextAction=[rough guess when the next Windows release will be] and we can do our due diligence to verify this then.
The NextAction date has arrived: 2018-04-16
Owner: kainino@chromium.org
Status: Assigned (was: ExternalDependency)
NextAction: 2018-05-16
Owner: ----
Status: ExternalDependency (was: Assigned)
The NextAction date has arrived: 2018-05-16

Comment 23 by kainino@google.com, May 21 2018

Cc: rafael.c...@microsoft.com
Owner: kainino@chromium.org
Rafael:
I tried this out on Chrome on Windows 1803. The problem seemed to persist. Does Chrome itself need to be built with a newer SDK?

Sign in to add a comment