[Piglit] Rounding mode in Piglit

tournier.elie tournier.elie at gmail.com
Wed Jun 28 09:13:57 UTC 2017

On 28 June 2017 at 07:06, Matt Turner <mattst88 at gmail.com> wrote:
> On Tue, Jun 27, 2017 at 3:43 AM, tournier.elie <tournier.elie at gmail.com> wrote:
>> Hello list,
>> The GLSL spec said "The rounding mode cannot be set and is undefined"
>> but in Piglit, we implicitly define a rounding mode.
>> Indeed, in some test like
>> "generated_tests/spec/arb_gpu_shader_fp64/execution/conversion/vert-conversion-explicit-double-uint.shader_test",
>> we check if uint(1.9467) == 1.
>> Depending on the rounding mode, we can have uint(1,9467) = 1 or
>> uint(1,9467) = 2.
>> Is it normal or should we change the tests to allow these 2 values?
> The rounding mode is undefined, but the GLSL spec explicitly says (in
> 5.4.1 Conversion and Scalar Constructors):
> When constructors are used to convert any floating-point type to an
> integer type, the fractional part of the
> floating-point value is dropped. It is undefined to convert a negative
> floating-point value to an uint.
> So uint(1.9467) is always 1u.

OK thank you for the answer.
I added the GLSL Spec in my code as a comment.

More information about the Piglit mailing list