Mesa (7.10): intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.
Kenneth Graunke
kwg at kemper.freedesktop.org
Thu May 19 18:44:35 UTC 2011
Module: Mesa
Branch: 7.10
Commit: c66ffcf6639dffa53050fb2ed5da7c5287cdc19a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c66ffcf6639dffa53050fb2ed5da7c5287cdc19a
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Tue Mar 1 11:15:34 2011 -0800
intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.
Nexuiz was hitting a software fallback.
(cherry-picked from commit d1fc920f613aa349e6721963e22e12c6eb49e3f9)
---
src/mesa/drivers/dri/intel/intel_tex_copy.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index c6bc3d9..de42ac3 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -78,6 +78,7 @@ do_copy_texsubimage(struct intel_context *intel,
{
struct gl_context *ctx = &intel->ctx;
struct intel_renderbuffer *irb;
+ bool copy_supported = false;
bool copy_supported_with_alpha_override = false;
intel_prepare_render(intel);
@@ -90,13 +91,21 @@ do_copy_texsubimage(struct intel_context *intel,
return GL_FALSE;
}
+ copy_supported = intelImage->base.TexFormat == irb->Base.Format;
+
+ /* Converting ARGB8888 to XRGB8888 is trivial: ignore the alpha bits */
+ if (irb->Base.Format == MESA_FORMAT_ARGB8888 &&
+ intelImage->base.TexFormat == MESA_FORMAT_XRGB8888) {
+ copy_supported = true;
+ }
+
+ /* Converting XRGB8888 to ARGB8888 requires setting the alpha bits to 1.0 */
if (irb->Base.Format == MESA_FORMAT_XRGB8888 &&
intelImage->base.TexFormat == MESA_FORMAT_ARGB8888) {
copy_supported_with_alpha_override = true;
}
- if (intelImage->base.TexFormat != irb->Base.Format &&
- !copy_supported_with_alpha_override) {
+ if (!copy_supported && !copy_supported_with_alpha_override) {
if (unlikely(INTEL_DEBUG & DEBUG_FALLBACKS))
fprintf(stderr, "%s mismatched formats %s, %s\n",
__FUNCTION__,
More information about the mesa-commit
mailing list