<div dir="ltr">On 22 August 2013 16:07, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
.../built-in-functions/const-fma.shader_test | 38 ++++++++++++++++++++++<br>
1 file changed, 38 insertions(+)<br>
create mode 100644 tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test<br>
<br>
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<br>
new file mode 100644<br>
index 0000000..f23ffd7<br>
--- /dev/null<br>
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test<br>
@@ -0,0 +1,38 @@<br>
+[require]<br>
+GLSL >= 1.50<br>
+GL_ARB_gpu_shader5<br>
+<br>
+[vertex shader]<br>
+in vec4 vertex;<br>
+<br>
+void main() {<br>
+ gl_Position = vertex;<br>
+}<br>
+<br>
+[fragment shader]<br>
+#extension GL_ARB_gpu_shader5 : enable<br>
+<br>
+out vec4 color;<br>
+<br>
+void main()<br>
+{<br>
+ color = vec4(0.0, 1.0, 0.0, 1.0);<br>
+<br>
+ 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))) {<br>
+ color.r = 1.0;<br>
+ }<br>
+ 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))) {<br>
+ color.r = 1.0;<br>
+ }<br></blockquote><div><br></div><div>This test doesn't verify that fma() is constant-folded. I'd recommend doing the array size trick (see my comments on patch 5/8) here as well.<br><br></div><div>With that changed, the patch is:<br>
<br></div><div>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br><br></div><div>Patches 1-4 and 6-7 are also:<br></div><div><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+}<br>
+<br>
+[vertex data]<br>
+vertex/float/2<br>
+-1.0 -1.0<br>
+ 1.0 -1.0<br>
+ 1.0 1.0<br>
+-1.0 1.0<br>
+<br>
+[test]<br>
+draw arrays GL_TRIANGLE_FAN 0 4<br>
+probe all rgba 0.0 1.0 0.0 1.0<br>
<span class=""><font color="#888888">--<br>
1.8.3.2<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>