[Piglit] [PATCH 8/8] arb_gpu_shader5: Add fma constant eval execution test.

Matt Turner mattst88 at gmail.com
Thu Aug 22 16:07:34 PDT 2013


---
 .../built-in-functions/const-fma.shader_test       | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test

diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test
new file mode 100644
index 0000000..f23ffd7
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test
@@ -0,0 +1,38 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+	gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_gpu_shader5 : enable
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(0.0, 1.0, 0.0, 1.0);
+
+	if (vec4(0.0, 1.0, 4.0, 7.0) != fma(vec4(0.0, 0.0, 2.0, 2.0), vec4(1.0, 1.0, 2.0, 2.0), vec4(0.0, 1.0, 0.0, 3.0))) {
+		color.r = 1.0;
+	}
+	if (vec4(-1.0, 0.0, -4.0, 1.0) != fma(vec4(0.0, -1.0, 2.0, 2.0), vec4(1.0, 1.0, -2.0, 2.0), vec4(-1.0, 1.0, 0.0, -3.0))) {
+		color.r = 1.0;
+	}
+}
+
+[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 0.0 1.0 0.0 1.0
-- 
1.8.3.2



More information about the Piglit mailing list