On 22 August 2012 11:29, Anuj Phogat <span dir="ltr"><<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Test uses glDrawPixels with dual source blending and fixed function<br>
pipeline in visualize_image(). According to ARB_blend_func_extended<br>
specs:<br>
<br>
"Rendering using any of the blend functions that consume the second<br>
input color (SRC1_COLOR, ONE_MINUS_SRC1_COLOR, SRC1_ALPHA or<br>
ONE_MINUS_SRC1_ALPHA) using fixed function will produce undefined<br>
results."<br>
<br>
Fix this by disabling the blending temporarily in visualize_image<br>
function.<br></blockquote><div><br>Looks good to me.<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Reported-by: Vadim Girlin <<a href="mailto:vadimgirlin@gmail.com">vadimgirlin@gmail.com</a>><br>
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br>
---<br>
.../draw-buffers-common.cpp | 10 ++++++++++<br>
1 files changed, 10 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp<br>
index 1a898b2..6f54dfe 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp<br>
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp<br>
@@ -699,9 +699,19 @@ draw_image_to_window_system_fb(int draw_buffer_count, bool rhs)<br>
GL_RGBA,<br>
GL_FLOAT, image);<br>
}<br>
+<br>
+ /* Rendering using gldrawPixels() with dual source blending enabled<br>
+ * produces undefined results. So, disable blending in visualize_image<br>
+ * function to avoid undefined behavior.<br>
+ */<br>
+ GLboolean isBlending;<br>
+ glGetBooleanv(GL_BLEND, &isBlending);<br>
+ glDisable(GL_BLEND);<br>
visualize_image(image, GL_RGBA,<br>
pattern_width, pattern_height,<br>
draw_buffer_count + 1, rhs);<br>
+ if(isBlending)<br>
+ glEnable(GL_BLEND);<br>
free(image);<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.7.6<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>