[Mesa-dev] [PATCH 32/41] intel: Mark needed resolves when first enabling HiZ on a miptree

Eric Anholt eric at anholt.net
Fri Nov 18 17:28:15 PST 2011


On Thu, 17 Nov 2011 19:58:59 -0800, Chad Versace <chad.versace at linux.intel.com> wrote:
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.c |   21 ++++++++++++++++++++-
>  1 files changed, 20 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> index 3540997..9ebeefc 100644
> --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> @@ -584,7 +584,26 @@ intel_miptree_alloc_hiz(struct intel_context *intel,
>                                       mt->height0,
>                                       mt->depth0,
>                                       true);
> -   return mt->hiz_mt != NULL;
> +
> +   if (!mt->hiz_mt)
> +      return false;
> +
> +   /* Mark that all slices need a HiZ resolve. */
> +   struct intel_resolve_map *head = &mt->hiz_map;
> +   for (int level = mt->first_level; level <= mt->last_level; ++level) {
> +      for (int layer = 0; layer < mt->level[level].depth; ++layer) {
> +	 head->next = malloc(sizeof(*head->next));
> +	 head->next->prev = head;
> +	 head->next->next = NULL;
> +	 head = head->next;
> +
> +	 head->level = level;
> +	 head->layer = layer;
> +	 head->need = INTEL_NEED_HIZ_RESOLVE;
> +      }
> +   }

I'm not convinced that this patch is required.

If we have just allocated our storage, the contents are undefined.  If
someone kicks things off by doing a glClear()-like operation on it, then
the no-resolve-needed initial state would be correct, since the hiz
buffer would get made consistent value at that point.  If someone loads
it up with depth image data, that should set a NEED_HIZ_RESOLVE at the
MapTextureImage/MapRenderbuffer time.  If someone does rendering that
isn't a clear operation, they've got undefined results outside of where
they drew (as expected), and undefined results where they drew if they
had some non-always/never depth test associated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111118/9acfd6c9/attachment.pgp>


More information about the mesa-dev mailing list