[Piglit] [PATCH 11/13] glsl-1.50: Modify tests to use draw rect

Ian Romanick idr at freedesktop.org
Tue Aug 27 18:45:54 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

Now that "draw rect" works in core profiles, use it!

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Paul Berry <stereotype441 at gmail.com> [v1]
Cc: Matt Turner <mattst88 at gmail.com>
---
 .../glsl-1.50/execution/geometry-basic.shader_test | 13 +++---------
 .../clip-distance-in-explicitly-sized.shader_test  | 13 +++---------
 .../geometry/generate-zero-primitives.shader_test  |  9 +--------
 .../interface-blocks-complex-vs-fs.shader_test     | 23 ++++++++--------------
 ...ce-blocks-same-uniform-varying-name.shader_test | 15 ++++----------
 .../interface-blocks-simple-varying.shader_test    | 15 ++++----------
 .../execution/interface-blocks-with-gs.shader_test | 13 +++---------
 tests/spec/glsl-1.50/execution/sanity.shader_test  | 13 +++---------
 .../glsl-1.50/execution/unused-outputs.shader_test | 13 +++---------
 .../varying-struct-basic-vs-fs.shader_test         | 13 +++---------
 10 files changed, 35 insertions(+), 105 deletions(-)

diff --git a/tests/spec/glsl-1.50/execution/geometry-basic.shader_test b/tests/spec/glsl-1.50/execution/geometry-basic.shader_test
index 06d0209..3954641 100644
--- a/tests/spec/glsl-1.50/execution/geometry-basic.shader_test
+++ b/tests/spec/glsl-1.50/execution/geometry-basic.shader_test
@@ -5,12 +5,12 @@ GLSL >= 1.50
 [vertex shader]
 #version 150
 
-in vec4 vertex;
+in vec4 piglit_vertex;
 out vec4 vertex_to_gs;
 
 void main()
 {
-  vertex_to_gs = vertex;
+  vertex_to_gs = piglit_vertex;
 }
 
 [geometry shader]
@@ -39,13 +39,6 @@ void main()
   color = vec4(0.0, 1.0, 0.0, 1.0);
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/glsl-1.50/execution/geometry/clip-distance-in-explicitly-sized.shader_test b/tests/spec/glsl-1.50/execution/geometry/clip-distance-in-explicitly-sized.shader_test
index e8d751e..005189b 100644
--- a/tests/spec/glsl-1.50/execution/geometry/clip-distance-in-explicitly-sized.shader_test
+++ b/tests/spec/glsl-1.50/execution/geometry/clip-distance-in-explicitly-sized.shader_test
@@ -12,11 +12,11 @@ out gl_PerVertex {
   vec4 gl_Position;
   float gl_ClipDistance[2];
 };
-in vec4 vertex;
+in vec4 piglit_vertex;
 
 void main()
 {
-  gl_Position = vertex;
+  gl_Position = piglit_vertex;
 }
 
 [geometry shader]
@@ -58,13 +58,6 @@ void main()
     gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/glsl-1.50/execution/geometry/generate-zero-primitives.shader_test b/tests/spec/glsl-1.50/execution/geometry/generate-zero-primitives.shader_test
index f648b34..879a3f2 100644
--- a/tests/spec/glsl-1.50/execution/geometry/generate-zero-primitives.shader_test
+++ b/tests/spec/glsl-1.50/execution/geometry/generate-zero-primitives.shader_test
@@ -22,15 +22,8 @@ void main()
 	gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
 }
 
-[vertex data]
-piglit_vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
 clear color 0 0 0 0
 clear
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgb 0.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/execution/interface-blocks-complex-vs-fs.shader_test b/tests/spec/glsl-1.50/execution/interface-blocks-complex-vs-fs.shader_test
index b3f33e7..e2cef35 100644
--- a/tests/spec/glsl-1.50/execution/interface-blocks-complex-vs-fs.shader_test
+++ b/tests/spec/glsl-1.50/execution/interface-blocks-complex-vs-fs.shader_test
@@ -2,7 +2,7 @@
 GLSL >= 1.50
 
 [vertex shader]
-in vec4 vertex;
+in vec4 piglit_vertex;
 
 uniform ublk {
     uniform vec4 color;
@@ -19,7 +19,7 @@ void vs4_set_a();
 
 void main()
 {
-    gl_Position = vertex;
+    gl_Position = piglit_vertex;
     r.r = c.color.r;
     vs2_set_gb();
     vs3_set_b();
@@ -124,35 +124,28 @@ void main()
     gl_FragColor.a = a;
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
 uniform vec4 ublk.color 1.0 0.0 0.0 0.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 1.0 0.0 0.0 0.0
 
 uniform vec4 ublk.color 0.0 1.0 0.0 0.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 0.0
 
 uniform vec4 ublk.color 0.0 0.0 1.0 0.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 0.0 1.0 0.0
 
 uniform vec4 ublk.color 0.0 0.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 0.0 0.0 1.0
 
 uniform vec4 ublk.color 1.0 0.0 1.0 0.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 1.0 0.0 1.0 0.0
 
 uniform vec4 ublk.color 0.0 1.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
 
diff --git a/tests/spec/glsl-1.50/execution/interface-blocks-same-uniform-varying-name.shader_test b/tests/spec/glsl-1.50/execution/interface-blocks-same-uniform-varying-name.shader_test
index cb7e2d8..7ffc29b 100644
--- a/tests/spec/glsl-1.50/execution/interface-blocks-same-uniform-varying-name.shader_test
+++ b/tests/spec/glsl-1.50/execution/interface-blocks-same-uniform-varying-name.shader_test
@@ -18,7 +18,7 @@
 GLSL >= 1.50
 
 [vertex shader]
-in vec4 vertex;
+in vec4 piglit_vertex;
 
 uniform block {
     uniform vec4 color;
@@ -30,7 +30,7 @@ out block {
 
 void main()
 {
-    gl_Position = vertex;
+    gl_Position = piglit_vertex;
     vcolor.color = ucolor.color;
 }
 
@@ -45,19 +45,12 @@ void main()
     gl_FragColor = vcolor.color;
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
 uniform vec4 block.color 1.0 0.0 1.0 0.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 1.0 0.0 1.0 0.0
 
 uniform vec4 block.color 0.0 1.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
 
diff --git a/tests/spec/glsl-1.50/execution/interface-blocks-simple-varying.shader_test b/tests/spec/glsl-1.50/execution/interface-blocks-simple-varying.shader_test
index f8f38c8..aa14c94 100644
--- a/tests/spec/glsl-1.50/execution/interface-blocks-simple-varying.shader_test
+++ b/tests/spec/glsl-1.50/execution/interface-blocks-simple-varying.shader_test
@@ -4,7 +4,7 @@ GLSL >= 1.50
 [vertex shader]
 #version 150
 
-in vec4 vertex;
+in vec4 piglit_vertex;
 
 uniform vec4 color;
 
@@ -16,7 +16,7 @@ out vec4 c;
 
 void main()
 {
-    gl_Position = vertex;
+    gl_Position = piglit_vertex;
     inst_a.a = color;
 }
 
@@ -32,19 +32,12 @@ void main()
     gl_FragColor = inst_b.a;
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
 uniform vec4 color 0.0 0.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 0.0 0.0 1.0
 
 uniform vec4 color 0.0 1.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
 
diff --git a/tests/spec/glsl-1.50/execution/interface-blocks-with-gs.shader_test b/tests/spec/glsl-1.50/execution/interface-blocks-with-gs.shader_test
index de0a4a7..5a91822 100644
--- a/tests/spec/glsl-1.50/execution/interface-blocks-with-gs.shader_test
+++ b/tests/spec/glsl-1.50/execution/interface-blocks-with-gs.shader_test
@@ -5,7 +5,7 @@ GLSL >= 1.50
 [vertex shader]
 #version 150
 
-in vec4 vertex;
+in vec4 piglit_vertex;
 
 out block {
   vec4 vertex_to_gs;
@@ -13,7 +13,7 @@ out block {
 
 void main()
 {
-  vertex_to_gs = vertex;
+  vertex_to_gs = piglit_vertex;
 }
 
 [geometry shader]
@@ -44,14 +44,7 @@ void main()
   color = vec4(0.0, 1.0, 0.0, 1.0);
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
--1.0  1.0
- 1.0  1.0
- 1.0 -1.0
-
 [test]
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
 
diff --git a/tests/spec/glsl-1.50/execution/sanity.shader_test b/tests/spec/glsl-1.50/execution/sanity.shader_test
index 96d1484..2c261d3 100644
--- a/tests/spec/glsl-1.50/execution/sanity.shader_test
+++ b/tests/spec/glsl-1.50/execution/sanity.shader_test
@@ -16,22 +16,15 @@ void main() {
     color = u_color;
 }
 
-[vertex data]
-piglit_vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
 uniform vec4 u_color 1.0 0.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 1.0 0.0 0.0 1.0
 
 uniform vec4 u_color 0.0 1.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
 
 uniform vec4 u_color 0.0 0.0 1.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 0.0 1.0 1.0
diff --git a/tests/spec/glsl-1.50/execution/unused-outputs.shader_test b/tests/spec/glsl-1.50/execution/unused-outputs.shader_test
index ed44d60..5620dc1 100644
--- a/tests/spec/glsl-1.50/execution/unused-outputs.shader_test
+++ b/tests/spec/glsl-1.50/execution/unused-outputs.shader_test
@@ -11,7 +11,7 @@ GLSL >= 1.50
 [vertex shader]
 #version 150
 
-in vec4 vertex;
+in vec4 piglit_vertex;
 
 out float a;
 out float b;
@@ -21,7 +21,7 @@ void main()
 {
 	a = 3.0;
 	b = 1.0;
-	gl_Position = vertex;
+	gl_Position = piglit_vertex;
 }
 
 [fragment shader]
@@ -35,14 +35,7 @@ void main()
 	gl_FragColor = vec4(0.0, b, 0.0, 1.0);
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
 
diff --git a/tests/spec/glsl-1.50/execution/varying-struct-basic-vs-fs.shader_test b/tests/spec/glsl-1.50/execution/varying-struct-basic-vs-fs.shader_test
index b10bb69..a805954 100644
--- a/tests/spec/glsl-1.50/execution/varying-struct-basic-vs-fs.shader_test
+++ b/tests/spec/glsl-1.50/execution/varying-struct-basic-vs-fs.shader_test
@@ -24,7 +24,7 @@ GLSL >= 1.50
 
 uniform float ref;
 
-in vec4 vertex;
+in vec4 piglit_vertex;
 struct Foo
 {
 	mat4 a;
@@ -39,7 +39,7 @@ out Foo foo;
 
 void main()
 {
-	gl_Position = vertex;
+	gl_Position = piglit_vertex;
 
 	foo.a = mat4(ref,        ref +  1.0, ref +  2.0, ref +  3.0,
 		     ref +  4.0, ref +  5.0, ref +  6.0, ref +  7.0,
@@ -108,14 +108,7 @@ void main()
 		color = vec4(0.0, 1.0, 0.0, 1.0);
 }
 
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
 [test]
 uniform float ref 137.035999074
-draw arrays GL_TRIANGLE_FAN 0 4
+draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
-- 
1.8.1.4



More information about the Piglit mailing list