[Piglit] [PATCH 07/11] arb_shading_language_420pack: Add test for implicit conversion of return types.

Matt Turner mattst88 at gmail.com
Fri May 24 18:28:04 PDT 2013


---
 .../implicit-return-type-conversion.shader_test    | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 tests/spec/arb_shading_language_420pack/execution/implicit-return-type-conversion.shader_test

diff --git a/tests/spec/arb_shading_language_420pack/execution/implicit-return-type-conversion.shader_test b/tests/spec/arb_shading_language_420pack/execution/implicit-return-type-conversion.shader_test
new file mode 100644
index 0000000..d2499b5
--- /dev/null
+++ b/tests/spec/arb_shading_language_420pack/execution/implicit-return-type-conversion.shader_test
@@ -0,0 +1,42 @@
+/* The ARB_shading_language_420pack says:
+ *
+ *     "If the type of returnValue does not match returnType, there must be an
+ *      implicit conversion in section 4.1.10 "Implicit Conversions" that
+ *      converts the type of returnValue to returnType, or a compile error will
+ *      result."
+ *
+ * Verify that implicit conversions of return values to match the function's
+ * return type work.
+ */
+
+[require]
+GLSL >= 1.30
+GL_ARB_shading_language_420pack
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main()
+{
+    gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_shading_language_420pack: enable
+
+vec4 func() { return ivec4(1, 0, 0, 1); }
+
+void main() {
+    gl_FragColor = func();
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 1.0 0.0 0.0 1.0
-- 
1.8.1.5



More information about the Piglit mailing list