[Piglit] [PATCH] Test some interactions with multiple inout parameters

Eric Anholt eric at anholt.net
Mon Mar 25 09:04:52 PDT 2013


Ian Romanick <idr at freedesktop.org> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> There are several variations of
>
> void foo(inout int i, inout float f);
> ...
> foo(i, f[i]);
>
> that Mesa's GLSL compiler gets wrong.  NVIDIA's closed-source driver
> (version 304.64) fails vs-inout-index-inout-mat2-col.shader_test and
> vs-inout-index-inout-mat2-row.shader_test, but passes the others.

> diff --git a/tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col.shader_test b/tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col.shader_test
> new file mode 100644
> index 0000000..ed01ab6
> --- /dev/null
> +++ b/tests/shaders/out-parameter-indexing/vs-inout-index-inout-mat2-col.shader_test
> @@ -0,0 +1,34 @@
> +[require]
> +GLSL >= 1.20
> +
> +[vertex shader]
> +uniform int u = 0;

I think you mean "u = 1" like the rest of the tests.

> +varying vec4 color;
> +
> +void func(inout int i, inout float f)
> +{
> +  i = 0;
> +  f = 1.;
> +}
> +
> +void main()
> +{
> +  mat2 m = mat2(0.);
> +  int i = u;
> +
> +  func(i, m[i][1]);
> +  color = vec4(m[0].x, m[0].y, m[1].x, m[1].y);
> +  gl_Position = gl_Vertex;
> +}
> +
> +[fragment shader]
> +varying vec4 color;
> +
> +void main()
> +{
> +  gl_FragColor = color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +relative probe rgb (.5, .5) (0., 1., 0.)

I'd rather see "probe all rgba" in these tests, since failing tests in
many cases on our hardware will intermittently fail a single pixel probe
even though they would consistently fail a probe all.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130325/717ebdb0/attachment.pgp>


More information about the Piglit mailing list