[Piglit] [PATCH 06/23] Port swizzle and writemask glsl tests from Glean to Piglit.
Fabian Bieler
fabianbieler at fastmail.fm
Thu Nov 23 20:45:58 UTC 2017
The tests "Swizzle in-place" and "Swizzled swizzle" were not ported because
the functionality is already tested in shaders/glsl-fs-swizzle-1.shader_test
and spec/glsl-1.10/execution/vs-swizzle-swizzle-rhs.shader_test, respectively.
Of the ported tests swizzle.shader_test and writemask.shader_test are trivial.
---
tests/spec/glsl-1.10/execution/swizzle-rgba.shader_test | 14 ++++++++++++++
tests/spec/glsl-1.10/execution/swizzle-stpq.shader_test | 14 ++++++++++++++
tests/spec/glsl-1.10/execution/swizzle.shader_test | 14 ++++++++++++++
.../glsl-1.10/execution/swizzled-expression.shader_test | 16 ++++++++++++++++
.../execution/swizzled-swizzled-swizzle.shader_test | 15 +++++++++++++++
.../execution/swizzled-writemask-rgba.shader_test | 14 ++++++++++++++
.../execution/swizzled-writemask-split.shader_test | 14 ++++++++++++++
.../execution/swizzled-writemask-stpq.shader_test | 14 ++++++++++++++
.../glsl-1.10/execution/swizzled-writemask.shader_test | 13 +++++++++++++
tests/spec/glsl-1.10/execution/writemask.shader_test | 15 +++++++++++++++
10 files changed, 143 insertions(+)
create mode 100644 tests/spec/glsl-1.10/execution/swizzle-rgba.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzle-stpq.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzle.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzled-expression.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzled-swizzled-swizzle.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzled-writemask-rgba.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzled-writemask-split.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzled-writemask-stpq.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/swizzled-writemask.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/writemask.shader_test
diff --git a/tests/spec/glsl-1.10/execution/swizzle-rgba.shader_test b/tests/spec/glsl-1.10/execution/swizzle-rgba.shader_test
new file mode 100644
index 0000000..ae90561
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzle-rgba.shader_test
@@ -0,0 +1,14 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ vec4 a = vec4(0.5, 0.25, 0.0, 1.0);
+ gl_FragColor = a.grrb;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.5, 0.5, 0.0)
diff --git a/tests/spec/glsl-1.10/execution/swizzle-stpq.shader_test b/tests/spec/glsl-1.10/execution/swizzle-stpq.shader_test
new file mode 100644
index 0000000..41ed7e3
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzle-stpq.shader_test
@@ -0,0 +1,14 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ vec4 a = vec4(0.5, 0.25, 0.0, 1.0);
+ gl_FragColor = a.tssp;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.5, 0.5, 0.0)
diff --git a/tests/spec/glsl-1.10/execution/swizzle.shader_test b/tests/spec/glsl-1.10/execution/swizzle.shader_test
new file mode 100644
index 0000000..9610287
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzle.shader_test
@@ -0,0 +1,14 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ vec4 a = vec4(0.5, 0.25, 0.0, 1.0);
+ gl_FragColor = a.yxxz;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.5, 0.5, 0.0)
diff --git a/tests/spec/glsl-1.10/execution/swizzled-expression.shader_test b/tests/spec/glsl-1.10/execution/swizzled-expression.shader_test
new file mode 100644
index 0000000..4d16ddf
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzled-expression.shader_test
@@ -0,0 +1,16 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ vec4 a = vec4(1, 1, 1, 1);
+ vec4 b = vec4(0.5, 0.2, 0.1, 0.8);
+ vec4 c = (a * b).wzyx;
+ gl_FragColor = c;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.8, 0.1, 0.2, 0.5)
diff --git a/tests/spec/glsl-1.10/execution/swizzled-swizzled-swizzle.shader_test b/tests/spec/glsl-1.10/execution/swizzled-swizzled-swizzle.shader_test
new file mode 100644
index 0000000..a52c96d
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzled-swizzled-swizzle.shader_test
@@ -0,0 +1,15 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ vec4 a = vec4(0.1, 0.2, 0.3, 0.4);
+ vec4 b = a.wzyx.yxwz.xxyz;
+ gl_FragColor = b;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.3, 0.3, 0.4, 0.1)
diff --git a/tests/spec/glsl-1.10/execution/swizzled-writemask-rgba.shader_test b/tests/spec/glsl-1.10/execution/swizzled-writemask-rgba.shader_test
new file mode 100644
index 0000000..2bf6be9
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzled-writemask-rgba.shader_test
@@ -0,0 +1,14 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ gl_FragColor.bg = vec2(1.0, 0.5);
+ gl_FragColor.ar = vec2(0.25, 0.75);
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.75, 0.5, 1.0, 0.25)
diff --git a/tests/spec/glsl-1.10/execution/swizzled-writemask-split.shader_test b/tests/spec/glsl-1.10/execution/swizzled-writemask-split.shader_test
new file mode 100644
index 0000000..1e3418b
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzled-writemask-split.shader_test
@@ -0,0 +1,14 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ gl_FragColor.zy = vec2(1.0, 0.5);
+ gl_FragColor.wx = vec2(0.25, 0.75);
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.75, 0.5, 1.0, 0.25)
diff --git a/tests/spec/glsl-1.10/execution/swizzled-writemask-stpq.shader_test b/tests/spec/glsl-1.10/execution/swizzled-writemask-stpq.shader_test
new file mode 100644
index 0000000..94eb3d4
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzled-writemask-stpq.shader_test
@@ -0,0 +1,14 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ gl_FragColor.pt = vec2(1.0, 0.5);
+ gl_FragColor.qs = vec2(0.25, 0.75);
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.75, 0.5, 1.0, 0.25)
diff --git a/tests/spec/glsl-1.10/execution/swizzled-writemask.shader_test b/tests/spec/glsl-1.10/execution/swizzled-writemask.shader_test
new file mode 100644
index 0000000..d1ab7a6
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/swizzled-writemask.shader_test
@@ -0,0 +1,13 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ gl_FragColor.zwxy = vec4(1.0, 0.5, 0.25, 0.75);
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.75, 1.0, 0.5)
diff --git a/tests/spec/glsl-1.10/execution/writemask.shader_test b/tests/spec/glsl-1.10/execution/writemask.shader_test
new file mode 100644
index 0000000..653f13f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/writemask.shader_test
@@ -0,0 +1,15 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+void main()
+{
+ gl_FragColor = vec4(1.0);
+ gl_FragColor.x = 0.5;
+ gl_FragColor.z = 0.25;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.5, 1.0, 0.25, 1.0)
--
2.7.4
More information about the Piglit
mailing list