[Piglit] [PATCH] Test proper operation of ++ and -- on integers.

Paul Berry stereotype441 at gmail.com
Mon Oct 31 20:32:40 PDT 2011


---
 .../execution/fs-decrement-int.shader_test         |   28 ++++++++++++++++++
 .../execution/fs-decrement-uint.shader_test        |   29 +++++++++++++++++++
 .../execution/fs-increment-int.shader_test         |   28 ++++++++++++++++++
 .../execution/fs-increment-uint.shader_test        |   29 +++++++++++++++++++
 .../execution/vs-decrement-int.shader_test         |   29 +++++++++++++++++++
 .../execution/vs-decrement-uint.shader_test        |   30 ++++++++++++++++++++
 .../execution/vs-increment-int.shader_test         |   29 +++++++++++++++++++
 .../execution/vs-increment-uint.shader_test        |   30 ++++++++++++++++++++
 8 files changed, 232 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.30/execution/fs-decrement-int.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/fs-decrement-uint.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/fs-increment-int.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/fs-increment-uint.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/vs-decrement-int.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/vs-decrement-uint.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/vs-increment-int.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/vs-increment-uint.shader_test

diff --git a/tests/spec/glsl-1.30/execution/fs-decrement-int.shader_test b/tests/spec/glsl-1.30/execution/fs-decrement-int.shader_test
new file mode 100644
index 0000000..d4706c1
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-decrement-int.shader_test
@@ -0,0 +1,28 @@
+# Test "--" operator on the "int" type.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform int starting_value;
+
+void main()
+{
+	int x = starting_value;
+	int a = x--;
+	int b = --x;
+	gl_FragColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[test]
+uniform int starting_value 3
+draw rect -1 -1 2 2
+probe all rgba 0.75 0.75 0.25 0.25
diff --git a/tests/spec/glsl-1.30/execution/fs-decrement-uint.shader_test b/tests/spec/glsl-1.30/execution/fs-decrement-uint.shader_test
new file mode 100644
index 0000000..3f26cde
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-decrement-uint.shader_test
@@ -0,0 +1,29 @@
+# Test "--" operator on the "uint" type.
+
+[require]
+GLSL >= 1.30
+GL >= 3.0
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform uint starting_value;
+
+void main()
+{
+	uint x = starting_value;
+	uint a = x--;
+	uint b = --x;
+	gl_FragColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[test]
+uniform uint starting_value 3
+draw rect -1 -1 2 2
+probe all rgba 0.75 0.75 0.25 0.25
diff --git a/tests/spec/glsl-1.30/execution/fs-increment-int.shader_test b/tests/spec/glsl-1.30/execution/fs-increment-int.shader_test
new file mode 100644
index 0000000..19f8957
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-increment-int.shader_test
@@ -0,0 +1,28 @@
+# Test "++" operator on the "int" type.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform int starting_value;
+
+void main()
+{
+	int x = starting_value;
+	int a = x++;
+	int b = ++x;
+	gl_FragColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[test]
+uniform int starting_value 1
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.25 0.75 0.75
diff --git a/tests/spec/glsl-1.30/execution/fs-increment-uint.shader_test b/tests/spec/glsl-1.30/execution/fs-increment-uint.shader_test
new file mode 100644
index 0000000..7ed14ef
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-increment-uint.shader_test
@@ -0,0 +1,29 @@
+# Test "++" operator on the "uint" type.
+
+[require]
+GLSL >= 1.30
+GL >= 3.0
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform uint starting_value;
+
+void main()
+{
+	uint x = starting_value;
+	uint a = x++;
+	uint b = ++x;
+	gl_FragColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[test]
+uniform uint starting_value 1
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.25 0.75 0.75
diff --git a/tests/spec/glsl-1.30/execution/vs-decrement-int.shader_test b/tests/spec/glsl-1.30/execution/vs-decrement-int.shader_test
new file mode 100644
index 0000000..640dde3
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/vs-decrement-int.shader_test
@@ -0,0 +1,29 @@
+# Test "--" operator on the "int" type.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+uniform int starting_value;
+
+void main()
+{
+	gl_Position = gl_Vertex;
+	int x = starting_value;
+	int a = x--;
+	int b = --x;
+	gl_FrontColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[fragment shader]
+#version 130
+void main()
+{
+	gl_FragColor = gl_Color;
+}
+
+[test]
+uniform int starting_value 3
+draw rect -1 -1 2 2
+probe all rgba 0.75 0.75 0.25 0.25
diff --git a/tests/spec/glsl-1.30/execution/vs-decrement-uint.shader_test b/tests/spec/glsl-1.30/execution/vs-decrement-uint.shader_test
new file mode 100644
index 0000000..7c2b056
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/vs-decrement-uint.shader_test
@@ -0,0 +1,30 @@
+# Test "--" operator on the "uint" type.
+
+[require]
+GLSL >= 1.30
+GL >= 3.0
+
+[vertex shader]
+#version 130
+uniform uint starting_value;
+
+void main()
+{
+	gl_Position = gl_Vertex;
+	uint x = starting_value;
+	uint a = x--;
+	uint b = --x;
+	gl_FrontColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[fragment shader]
+#version 130
+void main()
+{
+	gl_FragColor = gl_Color;
+}
+
+[test]
+uniform uint starting_value 3
+draw rect -1 -1 2 2
+probe all rgba 0.75 0.75 0.25 0.25
diff --git a/tests/spec/glsl-1.30/execution/vs-increment-int.shader_test b/tests/spec/glsl-1.30/execution/vs-increment-int.shader_test
new file mode 100644
index 0000000..630ded2
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/vs-increment-int.shader_test
@@ -0,0 +1,29 @@
+# Test "++" operator on the "int" type.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+uniform int starting_value;
+
+void main()
+{
+	gl_Position = gl_Vertex;
+	int x = starting_value;
+	int a = x++;
+	int b = ++x;
+	gl_FrontColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[fragment shader]
+#version 130
+void main()
+{
+	gl_FragColor = gl_Color;
+}
+
+[test]
+uniform int starting_value 1
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.25 0.75 0.75
diff --git a/tests/spec/glsl-1.30/execution/vs-increment-uint.shader_test b/tests/spec/glsl-1.30/execution/vs-increment-uint.shader_test
new file mode 100644
index 0000000..bf5edbd
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/vs-increment-uint.shader_test
@@ -0,0 +1,30 @@
+# Test "++" operator on the "uint" type.
+
+[require]
+GLSL >= 1.30
+GL >= 3.0
+
+[vertex shader]
+#version 130
+uniform uint starting_value;
+
+void main()
+{
+	gl_Position = gl_Vertex;
+	uint x = starting_value;
+	uint a = x++;
+	uint b = ++x;
+	gl_FrontColor = vec4(starting_value, a, b, x)/4.0;
+}
+
+[fragment shader]
+#version 130
+void main()
+{
+	gl_FragColor = gl_Color;
+}
+
+[test]
+uniform uint starting_value 1
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.25 0.75 0.75
-- 
1.7.6.4



More information about the Piglit mailing list