Mesa (master): mesa: Fix packing of stencil bits to MESA_FORMAT_Z32_FLOAT_X24S8.

Eric Anholt anholt at kemper.freedesktop.org
Fri Jan 6 17:58:09 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jan  4 17:53:39 2012 -0800

mesa: Fix packing of stencil bits to MESA_FORMAT_Z32_FLOAT_X24S8.

We were converting our ubyte stencil value to a float.  Just write it
as a uint, which overwrites the X24 part of X24S8 with 0 but shouldn't
matter.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/format_pack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index 840559b..4367711 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -2453,7 +2453,7 @@ _mesa_pack_ubyte_stencil_row(gl_format format, GLuint n,
       break;
    case MESA_FORMAT_Z32_FLOAT_X24S8:
       {
-         GLfloat *d = ((GLfloat *) dst);
+         GLuint *d = dst;
          GLuint i;
          for (i = 0; i < n; i++) {
             d[i * 2 + 1] = src[i];




More information about the mesa-commit mailing list