[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Public WebGL] GLSL constructor rules



I'm also in favor of a warning, the behavior is slightly odd but we don't want to introduce incompatibility without a very strong reason.

Getting a conformance test for the constructor behavior would be great.

-Olli
________________________________________
From: owner-public_webgl@khronos.org [owner-public_webgl@khronos.org] On Behalf Of Jeff Gilbert [jgilbert@mozilla.com]
Sent: Wednesday, January 15, 2014 1:36 AM
To: Tibor Ouden, den
Cc: public webgl
Subject: Re: [Public WebGL] GLSL constructor rules

I like warnings.

-Jeff

----- Original Message -----
From: "Tibor Ouden, den" <tibordenouden@gmail.com>
To: "public webgl" <public_webgl@khronos.org>
Sent: Tuesday, January 14, 2014 1:36:18 PM
Subject: [Public WebGL] GLSL constructor rules

I was lately bitten by an issue I really thought was a bug :
Initial version of code :
float f;
vec2 foo;
vec3 bar = vec3(f, foo);

Now I changed foo to type vec3 and it happily compiled (but did not work as
I expected :-) )
It turns out that as long as at least one component of the last argument is
used, this is a valid constructor expression.
(see GLSL ES Shading Language, 5.4 Constructors)

My personal opinion on this is that this is too flexible, I would like the
compiler to fail the compilation.

What do other developers think of the GLS constructor rules ?
Do they need to be more strict ?


Tibor den Ouden


P.S. : The pragmatic path here is probably request implementers to detect
the component count overflow and issue a warning :-)

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------


-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------