[Piglit] [PATCH 2/2] glsl-1.30: Add tests for signed-to-unsigned implicit conversion and vice-versa

Chad Versace chad at chad-versace.us
Mon Apr 25 13:34:17 PDT 2011


On 04/19/2011 01:10 PM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> ---
>  .../assign-implicit-conversion-int-uint.vert       |   19 +++++++++++++++++++
>  .../assign-implicit-conversion-ivec2-uvec2.vert    |   19 +++++++++++++++++++
>  .../assign-implicit-conversion-ivec3-uvec3.vert    |   19 +++++++++++++++++++
>  .../assign-implicit-conversion-ivec4-uvec4.vert    |   19 +++++++++++++++++++
>  .../assign-implicit-conversion-uint-int.vert       |   19 +++++++++++++++++++
>  .../assign-implicit-conversion-uvec2-ivec2.vert    |   19 +++++++++++++++++++
>  .../assign-implicit-conversion-uvec3-ivec3.vert    |   19 +++++++++++++++++++
>  .../assign-implicit-conversion-uvec4-ivec4.vert    |   19 +++++++++++++++++++
>  8 files changed, 152 insertions(+), 0 deletions(-)
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-int-uint.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-ivec2-uvec2.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-ivec3-uvec3.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-ivec4-uvec4.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-uint-int.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-uvec2-ivec2.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-uvec3-ivec3.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/basic-types/assign-implicit-conversion-uvec4-ivec4.vert


Each of these tests contain a single line of confusion.

> +void main()
> +{
> +	uint x = 5u;
> +	int y = x;

The test should fail here, and the values of x and y are no longer
important, yet x and y are used in the next line.

> +
> +	gl_Position = vec4(x, y, x, y);
> +}

I think that most people, if just briefly glancing at this test case,
would assume that the test failure should occur at the vec4 construction
and not at `int y = x`. I'd like to spare others those few few moments
of confusion.

Could you change the assignment to *not* use x and y, just to make clear
that test failure occurs before that point? Perhaps `gl_Position =
vec4(0, 0, 0, 1)`?

-- 
Chad Versace
chad at chad-versace.us


More information about the Piglit mailing list