anv/gen8+9: Invalidate color calc state when switching to the GPGPU pipeline
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 21 Jan 2016 01:26:41 +0000 (17:26 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 21 Jan 2016 08:31:29 +0000 (00:31 -0800)
Port 044acb9256046bebec890cac7e42043754459fc2 to anv.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
src/vulkan/gen8_cmd_buffer.c

index c15e5a5ef423001e2ecea68e295f8f3e3e780f7f..d4d01ea151bc6edd1afab9ea77aec9b64ccda242 100644 (file)
@@ -623,6 +623,20 @@ cmd_buffer_flush_compute_state(struct anv_cmd_buffer *cmd_buffer)
    config_l3(cmd_buffer, needs_slm);
 
    if (cmd_buffer->state.current_pipeline != GPGPU) {
+#if ANV_GEN < 10
+      /* From the Broadwell PRM, Volume 2a: Instructions, PIPELINE_SELECT:
+       *
+       *   Software must clear the COLOR_CALC_STATE Valid field in
+       *   3DSTATE_CC_STATE_POINTERS command prior to send a PIPELINE_SELECT
+       *   with Pipeline Select set to GPGPU.
+       *
+       * The internal hardware docs recommend the same workaround for Gen9
+       * hardware too.
+       */
+      anv_batch_emit(&cmd_buffer->batch,
+                     GENX(3DSTATE_CC_STATE_POINTERS));
+#endif
+
       anv_batch_emit(&cmd_buffer->batch, GENX(PIPELINE_SELECT),
 #if ANV_GEN >= 9
                      .MaskBits = 3,