Mesa (openchrome-branch): openchrome: Fix assymetric hardware mipmap generation.

Thomas Hellstrom thomash at kemper.freedesktop.org
Thu Feb 26 11:03:02 UTC 2009


Module: Mesa
Branch: openchrome-branch
Commit: ed56ed0931fce15f5d274f5dc5de5be320a7f688
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed56ed0931fce15f5d274f5dc5de5be320a7f688

Author: Thomas Hellstrom <thomas-at-shipmail-dot-org>
Date:   Thu Feb 26 12:01:27 2009 +0100

openchrome: Fix assymetric hardware mipmap generation.

---

 .../drivers/dri/openchrome/via_teximage_accel.c    |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/openchrome/via_teximage_accel.c b/src/mesa/drivers/dri/openchrome/via_teximage_accel.c
index 91e363a..4a3edb7 100644
--- a/src/mesa/drivers/dri/openchrome/via_teximage_accel.c
+++ b/src/mesa/drivers/dri/openchrome/via_teximage_accel.c
@@ -57,6 +57,8 @@ via_generate_one_mipmap(GLcontext * ctx,
     uint32_t stride;
     uint32_t src_stride;
     struct drm_via_clip_rect clip;
+    float xFactor;
+    float yFactor;
 
     if (src->texHwFormat == VIA_FMT_ERROR ||
 	dst->dstHwFormat == VIA_FMT_ERROR)
@@ -73,8 +75,11 @@ via_generate_one_mipmap(GLcontext * ctx,
     if (src_stride & 0x0F)
 	return GL_FALSE;
 
+    xFactor = (srcImage->Width == 1) ? 1.0f : 0.5f;
+    yFactor = (srcImage->Height == 1) ? 1.0f : 0.5f;
+
     via_meta_install_src(vmesa, 0xFFFFFFFF, 0x00000000, src_fmt,
-			 0.5f, 0.5f, srcImage->Width,
+			 xFactor, yFactor, srcImage->Width,
 			 srcImage->Height, src_stride, 0, GL_FALSE, src->buf);
 
     clip.x1 = 0;




More information about the mesa-commit mailing list