[Mesa-dev] [PATCH] mesa: fix format checking when doing a multisample resolve

Marek Olšák maraeo at gmail.com
Sat Jul 21 06:36:06 PDT 2012

Check the internal format instead of gl_format. Sometimes a driver may
allocate two textures of formats e.g. RGBA8888 and ARGB8888
from internalformat GL_RGBA8, and doing a resolve between those 2 GL_RGBA8
formats results in a GL error.

Technically speaking, a user getting the error has done nothing wrong and
the error is seemingly unfixable from the user standpoint. If a driver
allocates non-matching formats internally, it should be able to cope
with that.
 src/mesa/main/fbobject.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4370c72..d89cd4f 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2798,7 +2798,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
       /* color formats must match */
       if (colorReadRb &&
           colorDrawRb &&
-          colorReadRb->Format != colorDrawRb->Format) {
+          colorReadRb->InternalFormat != colorDrawRb->InternalFormat) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                 "glBlitFramebufferEXT(bad src/dst multisample pixel formats)");

More information about the mesa-dev mailing list