From c7c64d97836c71eaf2ee3fc6d384877170b8c844 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 1 Jun 2010 14:33:43 -0400 Subject: intel: Fallback to meta if we're asked to CopyTexImage2D from RGB to RGBA The pixel transfer rules state that we must set alpha to 1.0 in this case which we can't easily do with the blitter. We can do to passes: one that sets the alpha to 0xff and one that copies the RGB bits or we can just use the 3D engine. Neither approach seems worth it for this case. --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 549a4acc7d9..ddc2c337c8a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -74,6 +74,14 @@ get_teximage_source(struct intel_context *intel, GLenum internalFormat) return NULL; case GL_RGBA: case GL_RGBA8: + irb = intel_renderbuffer(intel->ctx.ReadBuffer->_ColorReadBuffer); + /* We're required to set alpha to 1.0 in this case, but we can't + * do that with the blitter, so fall back. We could use the 3D + * engine or do two passes with the blitter, but it doesn't seem + * worth it for this case. */ + if (irb->Base._BaseFormat == GL_RGB) + return NULL; + return irb->region; case GL_RGB: case GL_RGB8: return intel_readbuf_region(intel); -- cgit v1.2.3