[Mesa-dev] [PATCH v2 12/13] intel_mipmap_tree: all layers need hiz resolves with layered rendering

Paul Berry stereotype441 at gmail.com
Mon Jul 29 09:48:23 PDT 2013


On 19 July 2013 17:32, Jordan Justen <jordan.l.justen at intel.com> wrote:

> In intel_miptree_slice_set_needs_(depth|hiz)_resolve, if layered
> rendering is being used, then we need to mark all layers as
> needing depth or hiz resolves.
>

I think only intel_miptree_slice_set_needs_depth_resolve() needs to have
this behaviour, since it's the call that is made during rendering.
intel_miptree_slice_set_needs_hiz_resolve is only called from functions
that operate on a single layer at a time.

I'm also a little bothered by the fact that with this change,
intel_miptree_slice_set_needs_depth_resolve() doesn't really act the way
its name implies anymore.  I'd recommend moving the loop to its caller,
intel_renderbuffer_set_needs_depth_resolve(), so that
intel_miptree_slice_set_needs_depth_resolve() continues to do what it
sounds like (namely, mark a single slice as needing a depth resolve).


>
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c |   31
> +++++++++++++++++++++----
>  1 file changed, 27 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 900e1c2..be5edde 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -41,6 +41,7 @@
>
>  #include "main/enums.h"
>  #include "main/formats.h"
> +#include "main/fbobject.h"
>  #include "main/glformats.h"
>  #include "main/texcompress_etc.h"
>  #include "main/teximage.h"
> @@ -1321,11 +1322,22 @@ intel_miptree_slice_set_needs_hiz_resolve(struct
> intel_mipmap_tree *mt,
>                                           uint32_t level,
>                                           uint32_t layer)
>  {
> +   uint32_t end_layer = layer + 1;
> +
>     if (!intel_miptree_slice_has_hiz(mt, level, layer))
>        return;
>
> -   intel_resolve_map_set(&mt->hiz_map,
> -                        level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
> +   if (layer == 0 && mt->level[level].depth > 1) {
> +      GET_CURRENT_CONTEXT(ctx);
> +      struct gl_framebuffer *fb = ctx->DrawBuffer;
> +      if (fb->Layered)
> +         end_layer = mt->level[level].depth;
> +   }
> +
> +   for (; layer < end_layer; layer++) {
> +      intel_resolve_map_set(&mt->hiz_map,
> +                            level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
> +   }
>  }
>
>
> @@ -1334,11 +1346,22 @@ intel_miptree_slice_set_needs_depth_resolve(struct
> intel_mipmap_tree *mt,
>                                              uint32_t level,
>                                              uint32_t layer)
>  {
> +   uint32_t end_layer = layer + 1;
> +
>     if (!intel_miptree_slice_has_hiz(mt, level, layer))
>        return;
>
> -   intel_resolve_map_set(&mt->hiz_map,
> -                        level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
> +   if (layer == 0 && mt->level[level].depth > 1) {
> +      GET_CURRENT_CONTEXT(ctx);
> +      struct gl_framebuffer *fb = ctx->DrawBuffer;
> +      if (fb->Layered)
> +         end_layer = mt->level[level].depth;
> +   }
> +
> +   for (; layer < end_layer; layer++) {
> +      intel_resolve_map_set(&mt->hiz_map,
> +                            level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
> +   }
>  }
>
>  static bool
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130729/fbf6dc6d/attachment-0001.html>


More information about the mesa-dev mailing list