<div dir="ltr">On 19 July 2013 17:32, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In intel_miptree_slice_set_needs_(depth|hiz)_resolve, if layered<br>
rendering is being used, then we need to mark all layers as<br>
needing depth or hiz resolves.<br></blockquote><div><br></div><div>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.<br>
<br>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).<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 31 +++++++++++++++++++++----<br>
1 file changed, 27 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
index 900e1c2..be5edde 100644<br>
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c<br>
@@ -41,6 +41,7 @@<br>
<br>
#include "main/enums.h"<br>
#include "main/formats.h"<br>
+#include "main/fbobject.h"<br>
#include "main/glformats.h"<br>
#include "main/texcompress_etc.h"<br>
#include "main/teximage.h"<br>
@@ -1321,11 +1322,22 @@ intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,<br>
uint32_t level,<br>
uint32_t layer)<br>
{<br>
+ uint32_t end_layer = layer + 1;<br>
+<br>
if (!intel_miptree_slice_has_hiz(mt, level, layer))<br>
return;<br>
<br>
- intel_resolve_map_set(&mt->hiz_map,<br>
- level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);<br>
+ if (layer == 0 && mt->level[level].depth > 1) {<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ struct gl_framebuffer *fb = ctx->DrawBuffer;<br>
+ if (fb->Layered)<br>
+ end_layer = mt->level[level].depth;<br>
+ }<br>
+<br>
+ for (; layer < end_layer; layer++) {<br>
+ intel_resolve_map_set(&mt->hiz_map,<br>
+ level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);<br>
+ }<br>
}<br>
<br>
<br>
@@ -1334,11 +1346,22 @@ intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,<br>
uint32_t level,<br>
uint32_t layer)<br>
{<br>
+ uint32_t end_layer = layer + 1;<br>
+<br>
if (!intel_miptree_slice_has_hiz(mt, level, layer))<br>
return;<br>
<br>
- intel_resolve_map_set(&mt->hiz_map,<br>
- level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);<br>
+ if (layer == 0 && mt->level[level].depth > 1) {<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ struct gl_framebuffer *fb = ctx->DrawBuffer;<br>
+ if (fb->Layered)<br>
+ end_layer = mt->level[level].depth;<br>
+ }<br>
+<br>
+ for (; layer < end_layer; layer++) {<br>
+ intel_resolve_map_set(&mt->hiz_map,<br>
+ level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);<br>
+ }<br>
}<br>
<br>
static bool<br>
<span class=""><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>