[Mesa-stable] [PATCH] anv: Make sure state on primary is correct after CmdExecuteCommands

Alex Smith asmith at feralinteractive.com
Thu Jan 4 14:15:55 UTC 2018


After executing a secondary command buffer, we need to update certain
state on the primary command buffer to reflect changes by the secondary.
Otherwise subsequent commands may not have the correct state set.

This fixes various issues (rendering errors, GPU hangs) seen after
executing secondary command buffers in some cases.

Signed-off-by: Alex Smith <asmith at feralinteractive.com>
Cc: mesa-stable at lists.freedesktop.org
---
 src/intel/vulkan/genX_cmd_buffer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 0bd3874db7..f6129f9d67 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -1056,6 +1056,14 @@ genX(CmdExecuteCommands)(
       }
 
       anv_cmd_buffer_add_secondary(primary, secondary);
+
+      /* Make sure state on the primary reflects any state that was set by
+       * the secondary. If the secondary didn't set these, they will be at
+       * their default values, so we will re-set them next time they're
+       * needed on the primary.
+       */
+      primary->state.current_pipeline = secondary->state.current_pipeline;
+      primary->state.current_l3_config = secondary->state.current_l3_config;
    }
 
    /* Each of the secondary command buffers will use its own state base
-- 
2.13.6



More information about the mesa-stable mailing list