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

Author: Eric Anholt <e...@anholt.net>
Date:   Thu Nov 17 17:26:41 2011 -0800

mesa: Fix the datatype of GL_DEPTH32F_STENCIL8's depth channel.

Asking for the datatype of MESA_FORMAT_Z32_FLOAT_X24S8 is a bit funny
-- there's a float depth channel, and a stencil channel that doesn't
have a particular GLenum associated with its type, so what's the
correct response?

Because there is no query for stencil, just make this format's
datatype be that of the depth channel.  It fixes the depth query (and
thus a failure in piglit gl-3.0-required-sized-formats), and none of
the other consumers of the _mesa_get_format_datatype() API care.

v2: Add a comment for why the DataType is this way for this format.

Reviewed-by: Brian Paul <bri...@vmware.com>
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

---

 src/mesa/main/formats.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index d3b12d0..6709ef5 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1491,7 +1491,10 @@ static struct gl_format_info 
format_info[MESA_FORMAT_COUNT] =
       MESA_FORMAT_Z32_FLOAT_X24S8, /* Name */
       "MESA_FORMAT_Z32_FLOAT_X24S8", /* StrName */
       GL_DEPTH_STENCIL,            /* BaseFormat */
-      GL_NONE /* XXX */,           /* DataType */
+      /* DataType here is used to answer GL_TEXTURE_DEPTH_TYPE queries, and is
+       * never used for stencil because stencil is always GL_UNSIGNED_INT.
+       */
+      GL_FLOAT,                    /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
       0, 0, 0, 32, 8,              /* Lum/Int/Index/Depth/StencilBits */
       1, 1, 8                      /* BlockWidth/Height,Bytes */

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to