diff options
author | Alex Smith <[email protected]> | 2018-01-09 08:49:02 -0800 |
---|---|---|
committer | Alex Smith <[email protected]> | 2018-01-11 18:11:08 +0000 |
commit | 4fd85617c176e9222f84fda7634a74d060e982b1 (patch) | |
tree | 7d5b6bd50003a5c2d5ba8e899839c2258f3e78ca /src | |
parent | bb951d45f23f29310b8f2edc395a8b774f9e1ab9 (diff) |
anv: Make sure state on primary is correct after CmdExecuteCommands
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.
v2 (Jason Ekstrand):
- Reset to invalid values instead of pulling from the secondary
- Change the comment to be more descriptive
Signed-off-by: Alex Smith <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Cc: [email protected]
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index ac95f3ad05a..e872749d4c1 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1078,6 +1078,15 @@ genX(CmdExecuteCommands)( anv_cmd_buffer_add_secondary(primary, secondary); } + /* The secondary may have selected a different pipeline (3D or compute) and + * may have changed the current L3$ configuration. Reset our tracking + * variables to invalid values to ensure that we re-emit these in the case + * where we do any draws or compute dispatches from the primary after the + * secondary has returned. + */ + primary->state.current_pipeline = UINT32_MAX; + primary->state.current_l3_config = NULL; + /* Each of the secondary command buffers will use its own state base * address. We need to re-emit state base address for the primary after * all of the secondaries are done. |