summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-04-16 15:33:43 -0500
committerMarge Bot <[email protected]>2020-04-19 02:41:22 +0000
commit969aeb6a93aefd037b130e4b37f58043fef493c3 (patch)
tree68bd38100cb6e4cb475651365d32e75effea433e /src/intel
parentffc84eac0d5a0c30e445fcdb2f0cfd0c5bf5321d (diff)
anv: Apply any needed PIPE_CONTROLs before emitting state
Push constants in particular can get picked up by the hardware at weird times that happen *before* 3DPRIMITIVE. Therefore, we need to flush before we emit all our state to ensure that any data they may pick up is in memory in time. This fixes an app which does vkCmdCopyBuffers immediately followed by a vkCmdBeginRenderPass and vkCmdDraw which uses the destination of the copy as a UBO which we push. Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4601>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index efc05889f79..7be8ba819e6 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -3247,6 +3247,12 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
genX(flush_pipeline_select_3d)(cmd_buffer);
+ /* Apply any pending pipeline flushes we may have. We want to apply them
+ * now because, if any of those flushes are for things like push constants,
+ * the GPU will read the state at weird times.
+ */
+ genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
+
uint32_t vb_emit = cmd_buffer->state.gfx.vb_dirty & pipeline->vb_used;
if (cmd_buffer->state.gfx.dirty & ANV_CMD_DIRTY_PIPELINE)
vb_emit |= pipeline->vb_used;
@@ -4147,6 +4153,12 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
genX(flush_pipeline_select_gpgpu)(cmd_buffer);
+ /* Apply any pending pipeline flushes we may have. We want to apply them
+ * now because, if any of those flushes are for things like push constants,
+ * the GPU will read the state at weird times.
+ */
+ genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
+
if (cmd_buffer->state.compute.pipeline_dirty) {
/* From the Sky Lake PRM Vol 2a, MEDIA_VFE_STATE:
*