From 0dc700850acb81c7088ab740959441521f8d38d9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Jul 2009 18:02:42 -0700 Subject: [PATCH] intel: Partially fix fallback detection for glCopyTexSubImage. Really, we should be checking that the MesaTexFormat for the read buffer and the texture match, but the previous code wasn't even doing that, so matching the cpp should be an improvement (and potentially fix some hangs!). The previous code also rejected GL_RGB even though blitting the alpha channel to the ignored channel of an x8r8g8b8 texture should be fine, which tripped up compiz's blur plugin. --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 0335c133071..028b49c14d3 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -73,11 +73,8 @@ get_teximage_source(struct intel_context *intel, GLenum internalFormat) return NULL; case GL_RGBA: case GL_RGBA8: - return intel_readbuf_region(intel); case GL_RGB: - if (intel->ctx.Visual.rgbBits == 16) - return intel_readbuf_region(intel); - return NULL; + return intel_readbuf_region(intel); default: return NULL; } @@ -99,8 +96,15 @@ do_copy_texsubimage(struct intel_context *intel, if (!intelImage->mt || !src) { if (INTEL_DEBUG & DEBUG_FALLBACKS) - fprintf(stderr, "%s fail %p %p\n", - __FUNCTION__, intelImage->mt, src); + fprintf(stderr, "%s fail %p %p (0x%08x)\n", + __FUNCTION__, intelImage->mt, src, internalFormat); + return GL_FALSE; + } + + if (intelImage->mt->cpp != src->cpp) { + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s fail %d vs %d cpp\n", + __FUNCTION__, intelImage->mt->cpp, src->cpp); return GL_FALSE; } -- 2.30.2