i965: Set render state for lossless compressed
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 23 Feb 2016 09:02:35 +0000 (11:02 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 12 May 2016 16:49:37 +0000 (19:49 +0300)
v2: Add support for blorp and removed the support for meta
v3 (Ben): Add assertion on compressed non-fast clear - must
          be partial clear.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
src/mesa/drivers/dri/i965/brw_draw.c

index c8eb87f9f40e703bce58fb9d508e74dc1e266bfe..9eeb89dbbbe9a0264f96a62d94f1aa9b6fc7e162 100644 (file)
@@ -2232,4 +2232,7 @@ brw_blorp_blit_miptrees(struct brw_context *brw,
    brw_blorp_exec(brw, &params);
 
    intel_miptree_slice_set_needs_hiz_resolve(dst_mt, dst_level, dst_layer);
+
+   if (intel_miptree_is_lossless_compressed(brw, dst_mt))
+      dst_mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_UNRESOLVED;
 }
index d6c846a57ce1870fbb95a4083585e8509682a474..23a7594ef58e56ff8d080453cbd5577153de511a 100644 (file)
@@ -344,6 +344,13 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
        * redundant clears.
        */
       irb->mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_CLEAR;
+   } else if (intel_miptree_is_lossless_compressed(brw, irb->mt)) {
+      /* Compressed buffers can be cleared also using normal rep-clear. In
+       * such case they bahave such as if they were drawn using normal 3D
+       * render pipeline, and we simply mark the mcs as dirty.
+       */
+      assert(partial_clear);
+      irb->mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_UNRESOLVED;
    }
 
    return true;
index dcbb6819aab6187993930ef3ee08860cee6f72fa..bb963f467f94126ab7cefa37c8c6e835bb934377 100644 (file)
@@ -386,8 +386,13 @@ brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
       struct intel_renderbuffer *irb =
          intel_renderbuffer(fb->_ColorDrawBuffers[i]);
 
-      if (irb)
+      if (irb) {
          brw_render_cache_set_add_bo(brw, irb->mt->bo);
+
+         if (intel_miptree_is_lossless_compressed(brw, irb->mt)) {
+            irb->mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_UNRESOLVED;
+         }
+      }
    }
 }