anv: Port over CACHE_MODE_1 optimization fix enables from brw.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 24 May 2017 04:33:12 +0000 (21:33 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 30 May 2017 21:59:31 +0000 (14:59 -0700)
Ben and I haven't observed these to help anything, but they enable
hardware optimizations for particular cases.  It's probably best to
enable them ahead of time, before we run into such a case.

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_state.c

index bf1217bbcdcca8abc54d0ca84ae5bc349982a59a..00c4105a8251d1ed6d758a97ef94266f730fbdc7 100644 (file)
@@ -52,6 +52,19 @@ genX(init_device_state)(struct anv_device *device)
       ps.PipelineSelection = _3D;
    }
 
+#if GEN_GEN >= 9
+   uint32_t cache_mode_1;
+   anv_pack_struct(&cache_mode_1, GENX(CACHE_MODE_1),
+                   .PartialResolveDisableInVC = true,
+                   .PartialResolveDisableInVCMask = true,
+                   .FloatBlendOptimizationEnable = true,
+                   .FloatBlendOptimizationEnableMask = true);
+   anv_batch_emit(&batch, GENX(MI_LOAD_REGISTER_IMM), lri) {
+      lri.RegisterOffset = GENX(CACHE_MODE_1_num);
+      lri.DataDWord      = cache_mode_1;
+   }
+#endif
+
    anv_batch_emit(&batch, GENX(3DSTATE_AA_LINE_PARAMETERS), aa);
 
    anv_batch_emit(&batch, GENX(3DSTATE_DRAWING_RECTANGLE), rect) {