On Tue, Jun 27, 2017 at 3:43 AM, tournier.elie <[email protected]> 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. _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
