i965/gen9: Prepare surface state setup for lossless compression
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 9 Dec 2015 12:44:21 +0000 (14:44 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 12 May 2016 16:49:22 +0000 (19:49 +0300)
v2 (Ben): Use combination of msaa_layout and number of samples
          instead of introducing explicit type for lossless
          compression (intel_miptree_is_lossless_compressed()).
v3 (Ben): Do not set fast claer state in surface state setup.
          Moved into brw_postdraw_set_buffers_need_resolve()
          using a separate patch.
v4: Support for blorp
v5 (Ben): Re-use gen8_get_aux_mode()

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/gen8_blorp.c
src/mesa/drivers/dri/i965/gen8_surface_state.c

index 4696faf082e83912e4650f060fb2cda50c0f63b2..fce510c8fe0bd69a3b8f945ec78a26206a819346 100644 (file)
 #define GEN8_SURFACE_AUX_MODE_MCS               1
 #define GEN8_SURFACE_AUX_MODE_APPEND            2
 #define GEN8_SURFACE_AUX_MODE_HIZ               3
+#define GEN9_SURFACE_AUX_MODE_CCS_E             5
 
 /* Surface state DW7 */
 #define GEN9_SURFACE_RT_COMPRESSION_SHIFT       30
index 5cd070fa4733bd936b97fdcdad416c44c8cc4ea4..05ef54c4d0a1e18e062a4118d8eadc1481cd75bd 100644 (file)
@@ -77,7 +77,7 @@ gen8_blorp_emit_surface_state(struct brw_context *brw,
       surf[6] = SET_FIELD(surface->mt->qpitch / 4, GEN8_SURFACE_AUX_QPITCH) |
                 SET_FIELD((surface->mt->mcs_mt->pitch / 128) - 1,
                           GEN8_SURFACE_AUX_PITCH) |
-                GEN8_SURFACE_AUX_MODE_MCS;
+                gen8_get_aux_mode(brw, mt);
    } else {
       surf[6] = 0;
    }
index 4f9a6e96fe92b74ee45a480277b629858be8996b..4b9896fe7d6ae2c3f79bb5486cddfcb058b4358a 100644 (file)
@@ -216,6 +216,9 @@ gen8_get_aux_mode(const struct brw_context *brw,
    if (brw->gen >= 9 || mt->num_samples == 1)
       assert(mt->halign == 16);
 
+   if (intel_miptree_is_lossless_compressed(brw, mt))
+      return GEN9_SURFACE_AUX_MODE_CCS_E;
+
    return GEN8_SURFACE_AUX_MODE_MCS;
 }