intel: Update comment about how depth/stencil miptrees are handled.

This evolved over several commits, and I also wanted to document some
new information about how we handle formats.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
Eric Anholt 2011-11-30 08:41:52 -08:00
parent 96159c37e3
commit 5b27e44652
1 changed files with 18 additions and 6 deletions

View File

@ -139,6 +139,19 @@ struct intel_mipmap_tree
/* Effectively the key: /* Effectively the key:
*/ */
GLenum target; GLenum target;
/**
* Generally, this is just the same as the gl_texture_image->TexFormat or
* gl_renderbuffer->Format.
*
* However, for textures and renderbuffers with packed depth/stencil formats
* on hardware where we want or need to use separate stencil, there will be
* two miptrees for storing the data. If the depthstencil texture or rb is
* MESA_FORMAT_Z32_FLOAT_X24S8, then mt->format will be
* MESA_FORMAT_Z32_FLOAT, otherwise for MESA_FORMAT_S8_Z24 objects it will be
* MESA_FORMAT_S8_Z24 (textures) or MESA_FORMAT_X8_Z24 (renderbuffers).
* mt->stencil_mt->format will always be MESA_FORMAT_S8.
*/
gl_format format; gl_format format;
/** /**
@ -191,13 +204,12 @@ struct intel_mipmap_tree
/** /**
* \brief Stencil miptree for depthstencil textures. * \brief Stencil miptree for depthstencil textures.
* *
* This miptree is used for depthstencil textures that require separate * This miptree is used for depthstencil textures and renderbuffers that
* stencil. The stencil miptree's data is the golden copy of the * require separate stencil. It always has the true copy of the stencil
* parent miptree's stencil bits. When necessary, we scatter/gather the * bits, regardless of mt->format.
* stencil bits between the parent miptree and the stencil miptree.
* *
* \see intel_miptree_s8z24_scatter() * \see intel_miptree_map_depthstencil()
* \see intel_miptree_s8z24_gather() * \see intel_miptree_unmap_depthstencil()
*/ */
struct intel_mipmap_tree *stencil_mt; struct intel_mipmap_tree *stencil_mt;