summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_cmd_buffer.c
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2016-03-10 17:19:13 -0800
committerJordan Justen <[email protected]>2016-03-12 13:13:37 -0800
commitb83785d86d2c7f07323920615c72a9f09695a9a7 (patch)
tree1f5fdf9db17d233714af06c5b8940993c9af2d18 /src/intel/vulkan/genX_cmd_buffer.c
parentc8ec65a1f5a85dbef3210dc49684fcfed49b7ea2 (diff)
anv/gen7: Add stall and flushes before switching pipelines
This is a port of 18c76551ee425b981efefc61f663a7781df17882 from OpenGL to Vulkan. Signed-off-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/genX_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 1ce53a81f1b..1b53f85419b 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -780,6 +780,30 @@ flush_pipeline_before_pipeline_select(struct anv_cmd_buffer *cmd_buffer,
*/
if (pipeline == GPGPU)
anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CC_STATE_POINTERS));
+#elif GEN_GEN <= 7
+ /* From "BXML » GT » MI » vol1a GPU Overview » [Instruction]
+ * PIPELINE_SELECT [DevBWR+]":
+ *
+ * Project: DEVSNB+
+ *
+ * Software must ensure all the write caches are flushed through a
+ * stalling PIPE_CONTROL command followed by another PIPE_CONTROL
+ * command to invalidate read only caches prior to programming
+ * MI_PIPELINE_SELECT command to change the Pipeline Select Mode.
+ */
+ anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL),
+ .RenderTargetCacheFlushEnable = true,
+ .DepthCacheFlushEnable = true,
+ .DCFlushEnable = true,
+ .PostSyncOperation = NoWrite,
+ .CommandStreamerStallEnable = true);
+
+ anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL),
+ .TextureCacheInvalidationEnable = true,
+ .ConstantCacheInvalidationEnable = true,
+ .StateCacheInvalidationEnable = true,
+ .InstructionCacheInvalidateEnable = true,
+ .PostSyncOperation = NoWrite);
#endif
}