[Piglit] [PATCH 21/23] Port linker glsl tests from Glean to Piglit.
Fabian Bieler
fabianbieler at fastmail.fm
Thu Nov 23 20:46:13 UTC 2017
---
.../gl_Position-not-written-check.shader_test | 18 +++++++++++++++
.../glsl-1.10/linker/texcoord-varying.shader_test | 27 ++++++++++++++++++++++
.../varying-read-but-not-written.shader_test | 21 +++++++++++++++++
.../linker/varying-var-mismatch.shader_test | 22 ++++++++++++++++++
4 files changed, 88 insertions(+)
create mode 100644 tests/spec/glsl-1.10/linker/gl_Position-not-written-check.shader_test
create mode 100644 tests/spec/glsl-1.10/linker/texcoord-varying.shader_test
create mode 100644 tests/spec/glsl-1.10/linker/varying-read-but-not-written.shader_test
create mode 100644 tests/spec/glsl-1.10/linker/varying-var-mismatch.shader_test
diff --git a/tests/spec/glsl-1.10/linker/gl_Position-not-written-check.shader_test b/tests/spec/glsl-1.10/linker/gl_Position-not-written-check.shader_test
new file mode 100644
index 0000000..66ef1c7
--- /dev/null
+++ b/tests/spec/glsl-1.10/linker/gl_Position-not-written-check.shader_test
@@ -0,0 +1,18 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+ gl_FrontColor = vec4(0.3);
+}
+
+
+[fragment shader]
+void main()
+{
+ gl_FragColor = gl_Color;
+}
+
+[test]
+link error
\ No newline at end of file
diff --git a/tests/spec/glsl-1.10/linker/texcoord-varying.shader_test b/tests/spec/glsl-1.10/linker/texcoord-varying.shader_test
new file mode 100644
index 0000000..e4b9b01
--- /dev/null
+++ b/tests/spec/glsl-1.10/linker/texcoord-varying.shader_test
@@ -0,0 +1,27 @@
+# Does the linker correctly recognize that texcoord[1] is
+# written by the vertex shader and read by the fragment shader?
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec4 gl_TexCoord[4];
+void main()
+{
+ int i = 1;
+ gl_TexCoord[i] = vec4(0.5, 0, 0, 0);
+ gl_Position = ftransform();
+}
+
+
+[fragment shader]
+varying vec4 gl_TexCoord[4];
+void main()
+{
+ gl_FragColor = gl_TexCoord[1];
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.5, 0.0, 0.0, 0.0)
diff --git a/tests/spec/glsl-1.10/linker/varying-read-but-not-written.shader_test b/tests/spec/glsl-1.10/linker/varying-read-but-not-written.shader_test
new file mode 100644
index 0000000..acf0a20
--- /dev/null
+++ b/tests/spec/glsl-1.10/linker/varying-read-but-not-written.shader_test
@@ -0,0 +1,21 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec4 foo;
+void main()
+{
+ gl_Position = ftransform();
+}
+
+
+[fragment shader]
+varying vec4 foo;
+void main()
+{
+ gl_FragColor = foo;
+}
+
+
+[test]
+link error
\ No newline at end of file
diff --git a/tests/spec/glsl-1.10/linker/varying-var-mismatch.shader_test b/tests/spec/glsl-1.10/linker/varying-var-mismatch.shader_test
new file mode 100644
index 0000000..4eec4e8
--- /dev/null
+++ b/tests/spec/glsl-1.10/linker/varying-var-mismatch.shader_test
@@ -0,0 +1,22 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec4 foo;
+void main()
+{
+ foo = gl_Color;
+ gl_Position = ftransform();
+}
+
+
+[fragment shader]
+varying vec4 bar;
+void main()
+{
+ gl_FragColor = bar;
+}
+
+
+[test]
+link error
\ No newline at end of file
--
2.7.4
More information about the Piglit
mailing list