intel/blorp/hiz: Always set sample number
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Mon, 11 Sep 2017 11:12:15 +0000 (14:12 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 21 Sep 2017 05:44:25 +0000 (08:44 +0300)
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/blorp/blorp_genX_exec.h

index 5f9a8ab4a510a74229ed7818fa3c92ef698542e4..53892620986c3953f52d03b42092e86b08c8d8f4 100644 (file)
@@ -1454,6 +1454,17 @@ blorp_emit_gen8_hiz_op(struct blorp_batch *batch,
    if (params->stencil.enabled)
       assert(params->hiz_op == BLORP_HIZ_OP_DEPTH_CLEAR);
 
+   /* From the BDW PRM Volume 2, 3DSTATE_WM_HZ_OP:
+    *
+    * 3DSTATE_MULTISAMPLE packet must be used prior to this packet to change
+    * the Number of Multisamples. This packet must not be used to change
+    * Number of Multisamples in a rendering sequence.
+    *
+    * Since HIZ may be the first thing in a batch buffer, play safe and always
+    * emit 3DSTATE_MULTISAMPLE.
+    */
+   blorp_emit_3dstate_multisample(batch, params);
+
    /* If we can't alter the depth stencil config and multiple layers are
     * involved, the HiZ op will fail. This is because the op requires that a
     * new config is emitted for each additional layer.