meta: Disable dithering during glBlitFramebuffer
authorNeil Roberts <neil@linux.intel.com>
Mon, 4 Aug 2014 19:54:03 +0000 (20:54 +0100)
committerNeil Roberts <neil@linux.intel.com>
Tue, 5 Aug 2014 13:48:15 +0000 (14:48 +0100)
According to the GL spec the only fragment operations that should affect
glBlitFramebuffer are “the pixel ownership test, the scissor test, and sRGB
conversion”. That implies that dithering should not be performed so we need to
disable it when implementing the blit with a render.

Before commit 05b52efbc97731 the dithering state would be left as whatever the
application picks (the default being GL_TRUE) and after that commit it was
explicitly enabled. Neither of these were correct.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81828
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/common/meta_blit.c

index 31c88e16b6f5115868109fac3a7eed5fe05e930c..955e73f57ca001df354ce887ec267c306a6bf252 100644 (file)
@@ -709,6 +709,9 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
     */
    _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_DRAW_BUFFERS);
 
+   /* Dithering shouldn't be performed for glBlitFramebuffer */
+   _mesa_set_enable(ctx, GL_DITHER, GL_FALSE);
+
    /* If the clipping earlier changed the destination rect at all, then
     * enable the scissor to clip to it.
     */