[Piglit] [PATCH 07/12] arb_shading_language_420pack: Test const-qualified function parameters.

Matt Turner mattst88 at gmail.com
Thu Jul 18 13:35:03 PDT 2013


---
 .../const-parameter-qualifier-no-writes.vert       | 22 ++++++++++++++++++++++
 .../qualifiers/const-parameter-qualifier.vert      | 19 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier-no-writes.vert
 create mode 100644 tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier.vert

diff --git a/tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier-no-writes.vert b/tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier-no-writes.vert
new file mode 100644
index 0000000..8722b20
--- /dev/null
+++ b/tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier-no-writes.vert
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.30
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ *
+ * From the GL_ARB_shading_language_420pack spec:
+ *
+ *     "Add the following parameter qualifier
+ *
+ *          Qualifier          Meaning
+ *          ---------          -------
+ *          const              for function parameters that cannot be written to"
+ *
+ * Test that writing to a const-qualified parameter results in a compile
+ * error.
+ */
+#version 130
+#extension GL_ARB_shading_language_420pack: enable
+void f(const float x) {
+    x = 1.0;
+}
diff --git a/tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier.vert b/tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier.vert
new file mode 100644
index 0000000..afe9f35
--- /dev/null
+++ b/tests/spec/arb_shading_language_420pack/compiler/qualifiers/const-parameter-qualifier.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.30
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ *
+ * From the GL_ARB_shading_language_420pack spec:
+ *
+ * "    Add the following parameter qualifier
+ *
+ *          Qualifier          Meaning
+ *          ---------          -------
+ *          const              for function parameters that cannot be written to"
+ *
+ * Test that const-qualifying a function parameter works.
+ */
+#version 130
+#extension GL_ARB_shading_language_420pack: enable
+void f(const float x) {}
-- 
1.8.1.5



More information about the Piglit mailing list