[Piglit] [PATCH] arb_shading_language_420pack: test invalid function return type

Tapani Pälli tapani.palli at intel.com
Thu Feb 21 11:50:37 UTC 2019


Extension adds implicit conversion for return types. This test checks
that driver does not incorrectly allow invalid return type.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 .../implicit-conversion-invalid-type.frag     | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 tests/spec/arb_shading_language_420pack/compiler/implicit-conversion-invalid-type.frag

diff --git a/tests/spec/arb_shading_language_420pack/compiler/implicit-conversion-invalid-type.frag b/tests/spec/arb_shading_language_420pack/compiler/implicit-conversion-invalid-type.frag
new file mode 100644
index 000000000..9fc24d9ee
--- /dev/null
+++ b/tests/spec/arb_shading_language_420pack/compiler/implicit-conversion-invalid-type.frag
@@ -0,0 +1,21 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.30
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 130
+#extension GL_ARB_shading_language_420pack: enable
+
+out vec4 color;
+
+int test()
+{
+	/* Return invalid type, this should not succeed. */
+	return ivec2(0);
+}
+
+void main()
+{
+        color = vec4(test());
+}
-- 
2.20.1



More information about the Piglit mailing list