[Mesa-dev] [PATCH v2 12/13] intel_mipmap_tree: all layers need hiz resolves with layered rendering
Jordan Justen
jordan.l.justen at intel.com
Fri Jul 19 17:32:58 PDT 2013
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.
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
More information about the mesa-dev
mailing list