[Piglit] [PATCH 06/11] arb_shading_language_420pack: Add scalar swizzle test.

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


---
 .../execution/scalar-swizzle.shader_test           | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 tests/spec/arb_shading_language_420pack/execution/scalar-swizzle.shader_test

diff --git a/tests/spec/arb_shading_language_420pack/execution/scalar-swizzle.shader_test b/tests/spec/arb_shading_language_420pack/execution/scalar-swizzle.shader_test
new file mode 100644
index 0000000..1c632ad
--- /dev/null
+++ b/tests/spec/arb_shading_language_420pack/execution/scalar-swizzle.shader_test
@@ -0,0 +1,46 @@
+/* The ARB_shading_language_420pack says:
+ *
+ *     "The component names x, r, and s are, for example, synonyms for the same
+ *      (first) component in a vector.  They are also the names of the only
+ *      component in a scalar.
+ *
+ *      Add to the example
+ *
+ *          float height;
+ *          height.x // is legal
+ *          height.y // is illegal"
+ *
+ * Verify that swizzles on scalars 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
+
+void main() {
+    float a = 1.0;
+
+    gl_FragColor = a.xxxx;
+}
+
+[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 1.0 1.0 1.0
-- 
1.8.1.5



More information about the Piglit mailing list