summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-06-01 14:33:43 -0400
committerKristian Høgsberg <[email protected]>2010-06-01 14:33:43 -0400
commitc7c64d97836c71eaf2ee3fc6d384877170b8c844 (patch)
tree3f9be7d5b2f76b4a72272a9c0578c00990d392b2
parentd12f2bb9c03a9e8a08824c849200f5b23c05914c (diff)
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.
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_copy.c8
1 files changed, 8 insertions, 0 deletions
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);