summaryrefslogtreecommitdiff
path: root/tests/spec/ext_framebuffer_multisample
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2012-08-22 11:19:53 -0700
committerAnuj Phogat <anuj.phogat@gmail.com>2012-08-22 15:51:01 -0700
commitcdbca6faf7e3a066776ad0424fc04e8d7746c946 (patch)
tree6ece0982cfc5f934bb914e2ed73ee0ab927d1214 /tests/spec/ext_framebuffer_multisample
parenteb8768c7e337a301a44e8a3565de933e40b2df45 (diff)
msaa: Avoid undefined behavior in visualize_image function
Test uses glDrawPixels with dual source blending and fixed function pipeline in visualize_image(). According to ARB_blend_func_extended specs: "Rendering using any of the blend functions that consume the second input color (SRC1_COLOR, ONE_MINUS_SRC1_COLOR, SRC1_ALPHA or ONE_MINUS_SRC1_ALPHA) using fixed function will produce undefined results." Fix this by disabling the blending temporarily in visualize_image function. Reported-by: Vadim Girlin <vadimgirlin@gmail.com> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'tests/spec/ext_framebuffer_multisample')
-rw-r--r--tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
index 1a898b2ba..6f54dfe86 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
@@ -699,9 +699,19 @@ draw_image_to_window_system_fb(int draw_buffer_count, bool rhs)
GL_RGBA,
GL_FLOAT, image);
}
+
+ /* Rendering using gldrawPixels() with dual source blending enabled
+ * produces undefined results. So, disable blending in visualize_image
+ * function to avoid undefined behavior.
+ */
+ GLboolean isBlending;
+ glGetBooleanv(GL_BLEND, &isBlending);
+ glDisable(GL_BLEND);
visualize_image(image, GL_RGBA,
pattern_width, pattern_height,
draw_buffer_count + 1, rhs);
+ if(isBlending)
+ glEnable(GL_BLEND);
free(image);
}