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

diff --git 
a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-fma.shader_test 
b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-fma.shader_test
new file mode 100644
index 0000000..644a387
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-fma.shader_test
@@ -0,0 +1,62 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#extension GL_ARB_gpu_shader5 : enable
+
+in vec4 vertex;
+out vec4 color;
+
+uniform vec4 a, b, c;
+uniform vec4 expected;
+
+void main() {
+       gl_Position = vertex;
+
+       color = vec4(0.0, 1.0, 0.0, 1.0);
+
+       if (expected.x != fma(a.x, b.x, c.x)) {
+               color.r = 1.0;
+       }
+       if (expected.xy != fma(a.xy, b.xy, c.xy)) {
+               color.r = 1.0;
+       }
+       if (expected.xyz != fma(a.xyz, b.xyz, c.xyz)) {
+               color.r = 1.0;
+       }
+       if (expected != fma(a, b, c)) {
+               color.r = 1.0;
+       }
+}
+
+[fragment shader]
+in vec4 color;
+out vec4 frag_color;
+
+void main()
+{
+       frag_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform vec4 a 0.0 0.0 2.0 2.0
+uniform vec4 b 1.0 1.0 2.0 2.0
+uniform vec4 c 0.0 1.0 0.0 3.0
+uniform vec4 expected 0.0 1.0 4.0 7.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform vec4 a  0.0 -1.0  2.0  2.0
+uniform vec4 b  1.0  1.0 -2.0  2.0
+uniform vec4 c -1.0  1.0  0.0 -3.0
+uniform vec4 expected -1.0 0.0 -4.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
-- 
1.8.3.2

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to