GLSL bug: evaluation of vec(v=... , cond(v) ) vs vec(v=..., v)
Reported by
fabrice....@gmail.com,
May 2 2018
|
||||
Issue descriptionUserAgent: 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 !
,
May 2 2018
,
May 2 2018
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.
,
May 2 2018
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 )
,
May 2 2018
Please provide the contents of about:gpu from your system. Thanks. (Please do this for all of your bug reports.)
,
May 3 2018
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.
,
May 3 2018
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 ? )
,
May 3 2018
@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.
,
May 3 2018
@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 ?
,
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 |
||||
Comment 1 by susan.boorgula@chromium.org
, May 2 2018