Mesa (master): gallium: handle the case of util_pack_z_stencil(format= PIPE_FORMAT_S8_UNORM)

Brian Paul brianp at kemper.freedesktop.org
Wed Apr 8 14:23:56 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Apr  8 08:23:01 2009 -0600

gallium: handle the case of util_pack_z_stencil(format=PIPE_FORMAT_S8_UNORM)

Fixes failed assertion in glean fbo test.

---

 src/gallium/auxiliary/util/u_pack_color.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h
index 4ec7aee..eda883b 100644
--- a/src/gallium/auxiliary/util/u_pack_color.h
+++ b/src/gallium/auxiliary/util/u_pack_color.h
@@ -434,6 +434,9 @@ util_pack_z(enum pipe_format format, double z)
       if (z == 1.0)
          return 0xffffff00;
       return ((uint) (z * 0xffffff)) << 8;
+   case PIPE_FORMAT_S8_UNORM:
+      /* this case can get it via util_pack_z_stencil() */
+      return 0;
    default:
       debug_print_format("gallium: unhandled format in util_pack_z()", format);
       assert(0);
@@ -443,6 +446,7 @@ util_pack_z(enum pipe_format format, double z)
  
 
 /**
+ * Pack Z and/or stencil values into a 32-bit value described by format.
  * Note: it's assumed that z is in [0,1] and s in [0,255]
  */
 static INLINE uint
@@ -456,6 +460,10 @@ util_pack_z_stencil(enum pipe_format format, double z, uint s)
       break;
    case PIPE_FORMAT_Z24S8_UNORM:
       packed |= s;
+      break;
+   case PIPE_FORMAT_S8_UNORM:
+      packed |= s;
+      break;
    default:
       break;
    }




More information about the mesa-commit mailing list