anv: Re-emit all compute state on pipeline switch
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 7 Dec 2019 00:26:59 +0000 (18:26 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Sat, 7 Dec 2019 04:03:35 +0000 (04:03 +0000)
It's a very odd case to hit in the real world.  However, there are some
CTS tests which switch back and forth between dispatch and clear without
changing the pipeline.

Fixes: bc612536eb2f "anv: Emit a dummy MEDIA_VFE_STATE before switching..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/intel/vulkan/genX_cmd_buffer.c

index c764011eb5fc0b6bf83da87c3b51ed9abf2a5089..50c9d9ed12a748a349bf4a40f1f80d13fc302209 100644 (file)
@@ -4073,6 +4073,13 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer,
          vfe.NumberofURBEntries     = 2;
          vfe.URBEntryAllocationSize = 2;
       }
+
+      /* We just emitted a dummy MEDIA_VFE_STATE so now that packet is
+       * invalid. Set the compute pipeline to dirty to force a re-emit of the
+       * pipeline in case we get back-to-back dispatch calls with the same
+       * pipeline and a PIPELINE_SELECT in between.
+       */
+      cmd_buffer->state.compute.pipeline_dirty = true;
    }
 #endif