Mesa (master): st/mesa: stop using Map8[] tables in load_color_map_texture( )

Brian Paul brianp at kemper.freedesktop.org
Fri Feb 10 15:08:27 UTC 2012


Module: Mesa
Branch: master
Commit: 80fd3d2ca8ae96ebad55c49ed499602e4a669b5a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=80fd3d2ca8ae96ebad55c49ed499602e4a669b5a

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Feb  9 22:15:45 2012 -0700

st/mesa: stop using Map8[] tables in load_color_map_texture()

Use the float tables instead.  Pixel maps are seldom used so this
shouldn't be a big deal.  Next, we can get rid of the gl_pixelmap::Map8
array.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/mesa/state_tracker/st_atom_pixeltransfer.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c
index fb1e409..8d2317e 100644
--- a/src/mesa/state_tracker/st_atom_pixeltransfer.c
+++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c
@@ -116,11 +116,12 @@ load_color_map_texture(struct gl_context *ctx, struct pipe_resource *pt)
       for (j = 0; j < texSize; j++) {
          union util_color uc;
          int k = (i * texSize + j);
-         ubyte r = ctx->PixelMaps.RtoR.Map8[j * rSize / texSize];
-         ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize];
-         ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize];
-         ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize];
-         util_pack_color_ub(r, g, b, a, pt->format, &uc);
+         float rgba[4];
+         rgba[0] = ctx->PixelMaps.RtoR.Map[j * rSize / texSize];
+         rgba[1] = ctx->PixelMaps.GtoG.Map[i * gSize / texSize];
+         rgba[2] = ctx->PixelMaps.BtoB.Map[j * bSize / texSize];
+         rgba[3] = ctx->PixelMaps.AtoA.Map[i * aSize / texSize];
+         util_pack_color(rgba, pt->format, &uc);
          *(dest + k) = uc.ui;
       }
    }




More information about the mesa-commit mailing list