i965: Inline renderbuffer_att_set_needs_depth_resolve
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 25 May 2017 18:04:38 +0000 (11:04 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 8 Jun 2017 05:18:53 +0000 (22:18 -0700)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_clear.c
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/intel_fbo.c
src/mesa/drivers/dri/i965/intel_fbo.h

index ad0d9770ec29d5c7edc9499d63546a1efbf6c852..8a635e3ce4bca25b421ef9a225be7d3918fd5f15 100644 (file)
@@ -166,7 +166,7 @@ brw_fast_clear_depth(struct gl_context *ctx)
       mt->fast_clear_color.f32[0] = ctx->Depth.Clear;
    }
 
-   if (fb->MaxNumLayers > 0) {
+   if (depth_att->Layered) {
       intel_hiz_exec(brw, mt, depth_irb->mt_level,
                      depth_irb->mt_layer, depth_irb->layer_count,
                      BLORP_HIZ_OP_DEPTH_CLEAR);
@@ -178,7 +178,15 @@ brw_fast_clear_depth(struct gl_context *ctx)
    /* Now, the HiZ buffer contains data that needs to be resolved to the depth
     * buffer.
     */
-   intel_renderbuffer_att_set_needs_depth_resolve(depth_att);
+   if (depth_att->Layered) {
+      for (unsigned layer = 0; layer < depth_irb->layer_count; layer++) {
+         intel_miptree_slice_set_needs_depth_resolve(mt, depth_irb->mt_level,
+                                                     depth_irb->mt_layer + layer);
+      }
+   } else {
+      intel_miptree_slice_set_needs_depth_resolve(mt, depth_irb->mt_level,
+                                                  depth_irb->mt_layer);
+   }
 
    return true;
 }
index 23a3c6c5c8dfc2fd96055ddbb07f12289f7550fe..f7287318a5ad5e9ab40c48c682b18913422e4bae 100644 (file)
@@ -373,7 +373,17 @@ brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
    if (back_irb)
       back_irb->need_downsample = true;
    if (depth_irb && brw_depth_writes_enabled(brw)) {
-      intel_renderbuffer_att_set_needs_depth_resolve(depth_att);
+      if (depth_att->Layered) {
+         for (unsigned layer = 0; layer < depth_irb->layer_count; layer++) {
+            intel_miptree_slice_set_needs_depth_resolve(depth_irb->mt,
+                                                        depth_irb->mt_level,
+                                                        depth_irb->mt_layer + layer);
+         }
+      } else {
+         intel_miptree_slice_set_needs_depth_resolve(depth_irb->mt,
+                                                     depth_irb->mt_level,
+                                                     depth_irb->mt_layer);
+      }
       brw_render_cache_set_add_bo(brw, depth_irb->mt->bo);
    }
 
index c3c919c24faa7e254845f4410404d93f4abc5841..864ff32a1bbc066b20dafe2cd49424bbb0b1e59b 100644 (file)
@@ -937,21 +937,6 @@ intel_renderbuffer_has_hiz(struct intel_renderbuffer *irb)
    return intel_miptree_level_has_hiz(irb->mt, irb->mt_level);
 }
 
-void
-intel_renderbuffer_att_set_needs_depth_resolve(struct gl_renderbuffer_attachment *att)
-{
-   struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
-   if (irb->mt) {
-      if (att->Layered) {
-         intel_miptree_set_all_slices_need_depth_resolve(irb->mt, irb->mt_level);
-      } else {
-         intel_miptree_slice_set_needs_depth_resolve(irb->mt,
-                                                     irb->mt_level,
-                                                     irb->mt_layer);
-      }
-   }
-}
-
 void
 intel_renderbuffer_move_to_temp(struct brw_context *brw,
                                 struct intel_renderbuffer *irb,
index 40c4f27a3417ab0040570c5ef362df14d9c6c66e..86811b4225e98f4369fc29a72df70f2139f23a2a 100644 (file)
@@ -195,9 +195,6 @@ intel_renderbuffer_get_tile_offsets(struct intel_renderbuffer *irb,
 bool
 intel_renderbuffer_has_hiz(struct intel_renderbuffer *irb);
 
-void
-intel_renderbuffer_att_set_needs_depth_resolve(struct gl_renderbuffer_attachment *att);
-
 
 void intel_renderbuffer_move_to_temp(struct brw_context *brw,
                                      struct intel_renderbuffer *irb,