[Piglit] [PATCH 14/23] Port function call glsl tests from Glean to Piglit.

Fabian Bieler fabianbieler at fastmail.fm
Thu Nov 23 20:46:06 UTC 2017


"nested function calls (2)" was not ported because the functionality is
already tested in shaders/glsl-fs-functions-3.shader_test.
---
 .../compiler/struct/assign-immedita-to-const.frag  | 24 +++++++++++++++++++++
 ...nested-function-calls-same-function.shader_test | 20 +++++++++++++++++
 .../execution/nested-function-calls.shader_test    | 25 ++++++++++++++++++++++
 3 files changed, 69 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/compiler/struct/assign-immedita-to-const.frag
 create mode 100644 tests/spec/glsl-1.10/execution/nested-function-calls-same-function.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/nested-function-calls.shader_test

diff --git a/tests/spec/glsl-1.10/compiler/struct/assign-immedita-to-const.frag b/tests/spec/glsl-1.10/compiler/struct/assign-immedita-to-const.frag
new file mode 100644
index 0000000..fa35d19
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/struct/assign-immedita-to-const.frag
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Test for bug in TPPStreamCompiler::assignOperands?
+ */
+struct S {
+	float f;
+};
+
+void F(S s) {}
+
+const S s = S(0.0);
+
+void F()
+{
+	F(s);
+}
+
+void main()
+{
+	gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+}
diff --git a/tests/spec/glsl-1.10/execution/nested-function-calls-same-function.shader_test b/tests/spec/glsl-1.10/execution/nested-function-calls-same-function.shader_test
new file mode 100644
index 0000000..d90d8ab
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/nested-function-calls-same-function.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+float Half(const in float x)
+{
+	return 0.5 * x;
+}
+
+void main()
+{
+	float a = 0.5;
+	float b = Half(Half(a));
+	gl_FragColor = vec4(b);
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.125, 0.125, 0.125, 0.125)
diff --git a/tests/spec/glsl-1.10/execution/nested-function-calls.shader_test b/tests/spec/glsl-1.10/execution/nested-function-calls.shader_test
new file mode 100644
index 0000000..a15d7af
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/nested-function-calls.shader_test
@@ -0,0 +1,25 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+float Half(const in float x)
+{
+	return 0.5 * x;
+}
+
+float square(const in float x)
+{
+	return x * x;
+}
+
+void main()
+{
+	float a = 0.5;
+	float b = square(Half(1.0));
+	gl_FragColor = vec4(b);
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.25, 0.25, 0.25)
-- 
2.7.4



More information about the Piglit mailing list