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

Issue 838981 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

GLSL bug: evaluation of vec(v=... , cond(v) ) vs vec(v=..., v)

Reported by fabrice....@gmail.com, May 2 2018

Issue description

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

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

Steps to reproduce the problem:
v = 2; vec2( v = .5 , v < 1. ? 0 : 1)

What is the expected behavior?
vec2(.5, 0)

What went wrong?
gives vec2(.5,1)  : the test has been evaluated before 1st component.
But if instead we do v = 2; vec2( v = .5 , v), then the 2nd compoment is evaluated after (the expected behavior, BTW).

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? No
 firefox

Chrome version: 66.0.3359.139  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 29.0 r0

both on windows/angle and linux, firefox and chrome.
Possibly a bug in the way Angle unrolls vectors ?

may somebody set the flags 
Blink>WebGL  and  Internals>GPU>ANGLE ?
thanks !
 
Labels: Needs-Triage-M66

Comment 2 by rtoy@chromium.org, May 2 2018

Components: -Blink Internals>GPU>ANGLE Blink>WebGL

Comment 3 by kbr@chromium.org, May 2 2018

Cc: oetu...@nvidia.com
Submitter: thanks for the report.

This is certainly related to how the ternary operator is translated in the HLSL backend. I don't know how high priority we should make this.

nope: as I said, it also happen on linux, i.e. OpenGL.

( And I know Angle layer is processing vec and mat constructors, both solving and causing bugs )

Comment 5 by kbr@chromium.org, May 2 2018

Please provide the contents of about:gpu from your system. Thanks. (Please do this for all of your bug reports.)

Comment 6 by oetu...@nvidia.com, May 3 2018

Status: WontFix (was: Unconfirmed)
I don't think that the evaluation order is defined in this case. GLSL is not very explicit on this but can be assumed to inherit evaluation order from older C++ specs.
but what is even more puzzling is that the evaluation order differs in the 2 examples. 
That's why I suspect the layers upstream the driver ( e.g. maybe an effect of ternary operator precedence rules once injected in the rewritten code ? )
@kbr "Please provide the contents of about:gpu from your system. (Please do this for all of your bug reports.)"

I found this bug on 3 machines, 2 OS (W & L) + 2 ubuntu versions,  7 browsers in total (including OpenGL mode on/off).
Do you really need an about:gpu extration each time for each of these configurations ?
Each time I gave you one in the past, it seems you only extracted the GPU name + driver version: if it's the only info needed (sometime) it's a lot easier for me to give this specific info directly. 
@Olli: I don't know if it's related (via the way ternary is treated in HLSL), but I have ternary in switch not compiling at all on firefox windows:
switch(1) { case  1: v = a==0 ? 0 : 1 ;  break; }
https://www.shadertoy.com/view/MscfWM
( but it does work on chrome and firefox linux ).
Is there a place where little padawans like me can report them such bug ? Or do you have an open channel and it's uber-easy for you to transmit ?

Comment 10 by kbr@chromium.org, May 3 2018

fabrice.neyret@: it wasn't clear to me from the description on what platforms and GPUs this bug was happening. We would prefer if about:gpu was attached (as a plaintext file is fine, for example) for all machines against which you're reporting bugs like this.

Sign in to add a comment