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

Issue 625363 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
OOO until 2019-01-24
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 352807
issue 634813



Sign in to add a comment

Global invariant pragma leaks across shaders

Project Member Reported by kbr@chromium.org, Jul 2 2016

Issue description

The use of the global invariant pragma:
#pragma STDGL invariant(all)

is leaking state across shader compilations. This is the cause of a WebGL 2.0 conformance test failure when redistributing the shards, which changes the order of execution of tests: https://codereview.chromium.org/2116593004/ .

Reproduced so far on Mac on top-of-tree and Canary. Not sure how many other platforms are affected.

Conformance test is being written.

 

Comment 1 by kbr@chromium.org, Jul 2 2016

Status: Started (was: Assigned)

Comment 2 by kbr@chromium.org, Jul 2 2016

Labels: -OS-Mac OS-All
Conformance test added in https://github.com/KhronosGroup/WebGL/pull/1831 .

Fortunately, this seems to happen on all Chrome platforms, not just Mac.

Comment 3 by kbr@chromium.org, Jul 2 2016

Components: Internals>GPU>ANGLE
https://chromium-review.googlesource.com/358203 up for review fixing this.

Comment 4 by kbr@chromium.org, Jul 2 2016

Cc: aiolos@chromium.org eakuefner@chromium.org
For the record, it was found that this was happening when running these two WebGL 2.0 conformance tests in this order:

deqp_data_gles3_shaders_preprocessor
conformance2_textures_webgl_canvas_tex_2d_r11f_g11f_b10f_rgb_half_float

In order to get that to happen, it was necessary to apply the patches in https://codereview.chromium.org/2116593004/ and https://codereview.chromium.org/2122443002 , and run with:

./content/test/gpu/run_gpu_integration_test.py webgl_conformance --browser=release --webgl2-only=true --webgl-conformance-version=2.0.0 --read-abbreviated-json-results-from=content/test/data/gpu/webgl2_conformance_tests_output.json --total-shards=12 --shard-index=5 --filter-tests-after-sharding --test-filter=\(deqp_data_gles3_shaders_preprocessor\|conformance2_textures_webgl_canvas_tex_2d_r11f_g11f_b10f_rgb_half_float\) --extra-browser-args="--enable-logging=stderr" --show-stdout

Project Member

Comment 5 by bugdroid1@chromium.org, Jul 5 2016

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

commit ae2e19188cf0a9b035a27143f585df10e72ffabd
Author: Kenneth Russell <kbr@chromium.org>
Date: Sat Jul 02 02:52:52 2016

The global invariant pragma must not leak across compilations.

BUG= chromium:625363 
TEST=conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html

Change-Id: Ie8d38e44837fc87bb4c94e76e779ad41e8b79957
Reviewed-on: https://chromium-review.googlesource.com/358203
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>

[modify] https://crrev.com/ae2e19188cf0a9b035a27143f585df10e72ffabd/src/compiler/translator/Compiler.cpp
[modify] https://crrev.com/ae2e19188cf0a9b035a27143f585df10e72ffabd/src/compiler/translator/SymbolTable.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 5 2016

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

commit 6f88ffc45920456f0840acf3299c0a5e24bdebc9
Author: geofflang <geofflang@chromium.org>
Date: Tue Jul 05 16:21:08 2016

Roll ANGLE 474a08c..3820e9c

https://chromium.googlesource.com/angle/angle.git/+log/474a08c..3820e9c

BUG= chromium:625363 , 612205 , chromium:616176 , 407309 

TBR=jmadill@chromium.org

TEST=bots

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

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

[modify] https://crrev.com/6f88ffc45920456f0840acf3299c0a5e24bdebc9/DEPS

Comment 8 by kbr@chromium.org, Jul 7 2016

The test preprocessor.pragmas.pragma_fragment is buggy, and is in the skip list in the native dEQP. The only reason it has been passing in Chrome is because of the bug that https://chromium-review.googlesource.com/358203 fixed. The test has been removed from the WebGL conformance suite in https://github.com/KhronosGroup/WebGL/pull/1846 and the WebGL tests are being rolled forward to incorporate the fix.

Comment 9 by kbr@chromium.org, Jul 7 2016

Cc: kbr@chromium.org bajones@chromium.org
 Issue 598910  has been merged into this issue.
Project Member

Comment 10 by bugdroid1@chromium.org, Jul 7 2016

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

commit d40c0256d5086d392f78989778583f91a1526d34
Author: kbr <kbr@chromium.org>
Date: Thu Jul 07 05:33:36 2016

Roll WebGL 214fe8f..ae375e0

https://chromium.googlesource.com/external/khronosgroup/webgl.git/+log/214fe8f..ae375e0

BUG= 625363 

TEST=bots
TBR=zmo@chromium.org

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

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

[modify] https://crrev.com/d40c0256d5086d392f78989778583f91a1526d34/DEPS
[modify] https://crrev.com/d40c0256d5086d392f78989778583f91a1526d34/content/test/gpu/gpu_tests/webgl_conformance_expectations.py

Comment 11 by kbr@chromium.org, Jul 7 2016

Cc: qiankun....@intel.com xinghua....@intel.com yunchao...@intel.com
 Issue 622247  has been merged into this issue.
Project Member

Comment 12 by bugdroid1@chromium.org, Jul 7 2016

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

commit 8bad46d40e23671d4a723a2daf4ca1e252bb0617
Author: Kenneth Russell <kbr@chromium.org>
Date: Sat Jul 02 02:52:52 2016

The global invariant pragma must not leak across compilations.

BUG= chromium:625363 
TEST=conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html

Change-Id: I66389352b92211f4d7967772f68470c8e93405bd
Reviewed-on: https://chromium-review.googlesource.com/358515
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>

[modify] https://crrev.com/8bad46d40e23671d4a723a2daf4ca1e252bb0617/src/compiler/translator/Compiler.cpp
[modify] https://crrev.com/8bad46d40e23671d4a723a2daf4ca1e252bb0617/src/compiler/translator/SymbolTable.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jul 7 2016

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

commit 5e4f92dde66d2b1358ce7fa2e7b68d58500fa73f
Author: kbr <kbr@chromium.org>
Date: Thu Jul 07 23:42:38 2016

Roll ANGLE 5695fc9..8bad46d

https://chromium.googlesource.com/angle/angle.git/+log/5695fc9..8bad46d

BUG= chromium:625363 

TEST=bots

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

TBR=zmo@chromium.org

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

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

Project Member

Comment 14 by bugdroid1@chromium.org, Jul 9 2016

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

commit 1552cf3a3556bb5f03c3fa6403e1fd15e5b56deb
Author: zmo <zmo@chromium.org>
Date: Sat Jul 09 01:00:55 2016

Roll WebGL 4da7838..74a8e95

https://chromium.googlesource.com/external/khronosgroup/webgl.git/+log/4da7838..74a8e95

BUG= 625363 
TEST=bots
TBR=kbr@chromium.org
NOTRY=true
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel;tryserver.chromium.linux:linux_optional_gpu_tests_rel

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

[modify] https://crrev.com/1552cf3a3556bb5f03c3fa6403e1fd15e5b56deb/DEPS
[modify] https://crrev.com/1552cf3a3556bb5f03c3fa6403e1fd15e5b56deb/content/test/gpu/gpu_tests/webgl_conformance_expectations.py

Comment 15 by kbr@chromium.org, Jul 9 2016

Status: Fixed (was: Started)
Thanks Mo for rolling in the WebGL version removing the last buggy test. This is finally fixed.

Project Member

Comment 16 by bugdroid1@chromium.org, Jul 9 2016

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

commit cffff985306c9404f210edc29480305bbc3234c2
Author: catapult-deps-roller <catapult-deps-roller@chromium.org>
Date: Sat Jul 09 19:10:26 2016

Roll src/third_party/catapult/ 243e3dfbc..6cad5da3c (12 commits).

https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/243e3dfbc911..6cad5da3c39e

$ git log 243e3dfbc..6cad5da3c --date=short --no-merges --format='%ad %ae %s'

BUG= 625363 ,531641,472699, 623058 ,472699, 625852 

TBR=catapult-sheriff@chromium.org

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

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

Status: Assigned (was: Fixed)
WebglConformance_conformance_glsl_bugs_global_invariant_does_not_leak_across_shaders seems to be still failing in
https://build.chromium.org/p/chromium.gpu.fyi/builders/Linux%20Release%20%28New%20Intel%29/builds/2559
and
https://build.chromium.org/p/chromium.gpu.fyi/builders/Linux%20Debug%20%28New%20Intel%29/builds/2752

I'm seeing this error:

*** Error compiling VERTEX_SHADER '[object WebGLShader]':0:3(1): error: #extension directive is not allowed in the middle of a shader

Though I don't understand how it can be related to this test.
That's preceded by:
ERROR:shader_manager.cc(115)] Shader translator allowed/produced an invalid shader unless the driver is buggy:
I guess Intel driver doesn't like "#extension GL_ARB_gpu_shader5 : enable" in this:
--original-shader--

#pragma STDGL invariant(all)

void main()
{
    gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
}

--translated-shader--
#version 120
#pragma STDGL invariant(all)
#extension GL_ARB_gpu_shader5 : enable
void main(){
(gl_Position = vec4(0.0, 0.0, 0.0, 0.0));
(gl_Position = vec4(1.0, 0.0, 0.0, 1.0));
}

--info-log--
I think the issue is that the Intel is very conformant and disallows #extension to be after anything but #version

Instead of outputting
#version
#pragma
#extension

We should output
#version
#extension
#pragma
Actually this is a Mesa driver bug in interpreting this blurb from the GLSL spec: "the extension directives must occur before any non-preprocessor tokens.". I will make ANGLE work arounds this and file a Mesa bug.

Comment 22 by kbr@chromium.org, Jul 11 2016

Status: Fixed (was: Assigned)
Thanks Corentin for diagnosing this. Could you please file a follow-on bug about the need for the workaround and reference this one? Closing this as fixed again.

Comment 23 by kbr@chromium.org, Aug 5 2016

Blocking: 634813

Sign in to add a comment