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

Issue 612066 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 295792



Sign in to add a comment

WebGL 2.0 conformance2/glsl3/forbidden-operators.html test fails

Project Member Reported by qiankun....@intel.com, May 16 2016

Issue description

<b>Version: <Kenneth, what is the frequency?></b>
<b>OS: <please tell me it's not XP></b>

What steps will reproduce the problem?
(1) open chrome with command line: --enable-unsafe-es3-apis
(2) Open https://www.khronos.org/registry/webgl/sdk/tests/conformance2/glsl3/forbidden-operators.html?webglVersion=2

What is the expected output?
The test should pass in WebGL 2.0 context.

What do you see instead?
4 tests failed.
Error messages:
FAIL [unexpected link status] Using ternary operators with void is not allowed
FAIL [unexpected link status] Using sequence operators with arrays is not allowed
FAIL [unexpected link status] Using sequence operators with structs containing arrays is not allowed

This should be bug in ANGLE.

 

Comment 1 by kbr@chromium.org, May 16 2016

Blocking: 295792
Owner: cwallez@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 18 2016

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

commit 0d959258fc96c8e9c83fca46f62c112f150654f0
Author: Corentin Wallez <cwallez@chromium.org>
Date: Tue Jul 12 21:26:32 2016

ParseContext: validate additional restriction for the ? and , operators

WebGL2 shaders have added restriction to improve portability for some
OpenGL compilers that do not support arbitrary ternary and sequence
operators. It disallows these operators for arrays, structs containing
arrays and the void type.

BUG= 612066 

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

[modify] https://crrev.com/0d959258fc96c8e9c83fca46f62c112f150654f0/src/compiler/translator/ParseContext.cpp

Project Member

Comment 4 by bugdroid1@chromium.org, Jul 18 2016

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

commit 0db21f9f2bc7bee9c40c64c5ad192297d32a567c
Author: jmadill <jmadill@chromium.org>
Date: Mon Jul 18 18:45:41 2016

Roll ANGLE 4c32feb..5bc93c4

https://chromium.googlesource.com/angle/angle.git/+log/4c32feb..5bc93c4

BUG= 621031 , 628052 , 612066 
TBR=cwallez@chromium.org

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

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

[modify] https://crrev.com/0db21f9f2bc7bee9c40c64c5ad192297d32a567c/DEPS

Project Member

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

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

commit bb9dab02b66943ba8b778064237df7002241c876
Author: cwallez <cwallez@chromium.org>
Date: Mon Jul 18 23:48:47 2016

WebGL2 expectations: forbidden-operators.html should pass

BUG= 612066 
TBR=zmo@chromium.org
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/2154403002
Cr-Commit-Position: refs/heads/master@{#406150}

[modify] https://crrev.com/bb9dab02b66943ba8b778064237df7002241c876/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py

Status: Fixed (was: Started)

Comment 7 Deleted

WebGL 2 Chrome Shaders don’t compile

"WebGL2 shaders have added restriction to improve portability for some
OpenGL compilers that do not support arbitrary ternary and sequence
operators. It disallows these operators for arrays, structs containing
arrays and the void type."

This is breaking all of my really basic shaders, so you have too much enforcement going on for the comma operator.  The following shader should be perfectly valid GLSL ES2/3, and compiles fine in Firefox.  Chrome flags this as in invalid shader with the message.

GPU shader compiler log: ERROR: 0:2: ',' : sequence operator is not allowed for void, arrays, or structs containing arrays

This is only using commas to splice several declarations onto a single line.  There are no arrays, structs, void here.

#version 300 es
in vec4 position_,uv0_,normal_,tangent_;
out vec2 uv0;
out vec3 tangent,binormal,normal;
out vec4 position,shadowPos;
uniform mat4 modelToWorld,worldToClip,worldToShadow;
void calcBasis(vec4 tangent_,vec4 normal_,out vec3 tangent,out vec3 binormal){
        binormal.xyz=cross(tangent.xyz,normal.xyz);
}
void main(){
        position=position_*modelToWorld,gl_Position=position*worldToClip,shadowPos=position*worldToShadow,uv0=uv0_.xy,calcBasis(tangent_,normal_,tangent,binormal);
}
const vec4 lightDir=vec4(0.,-.707,.707,1.),lightColor=vec4(1.,1.,1.,1.),lightAmbient0=vec4(.05,.15,.05,0.),lightAmbient2=vec4(.05,.05,.15,0.);

Comment 9 by oetu...@nvidia.com, Aug 16 2016

Nope, there is void there: calcBasis() returns void. What's the reason you're putting all the operations inside main in the same statement, instead of having multiple statements separated by semicolon? 

Comment 10 by zmo@chromium.org, Aug 16 2016

The behavior difference between Chrome and Firefox should be resolved once Firefox rolls in the latest ANGLE. It's better you update your shaders.
These go through a GLSL source minifier, and the minification was a little better with commas.  Will see about fixing the void cases.

Comment 12 by a...@figma.com, Aug 17 2016

The easiest solution to keep the shader minifier was to have the calcBasis routine return a boolean that is always true.   Now the shaders compile again without the warning.

Sign in to add a comment