On 03/25/2013 09:04 AM, Eric Anholt wrote:
Ian Romanick <[email protected]> writes:

From: Ian Romanick <[email protected]>

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.

That was actually intentional, but I could change it. In this test the index selects the column of the matrix as m[i][1]. When I build the output (below), I expect m[0].y to be 1, and all the other fields to be 0.

+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.

Yeah, that's a good call.  I'll make that change.

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to