diff options
author | Samuel Pitoiset <[email protected]> | 2017-10-11 15:54:40 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-10-16 14:09:51 +0200 |
commit | 4e65b4ea4b28642dbf15e562cd7c845c060a0f0e (patch) | |
tree | a0c1b9b14bae92e81c78ad8255c0564563b25b80 | |
parent | 67dd52e7e86ce76789a97a8ab74defe647cc6ed4 (diff) |
radv: be smarter with pipelines when emitting secondary buffers
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 397f0db26c0..b01f1ee7efa 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2650,8 +2650,23 @@ void radv_CmdExecuteCommands( } primary->device->ws->cs_execute_secondary(primary->cs, secondary->cs); - primary->state.emitted_pipeline = secondary->state.emitted_pipeline; - primary->state.emitted_compute_pipeline = secondary->state.emitted_compute_pipeline; + + /* When the secondary command buffer is compute only we don't + * need to re-emit the current graphics pipeline. + */ + if (secondary->state.emitted_pipeline) { + primary->state.emitted_pipeline = + secondary->state.emitted_pipeline; + } + + /* When the secondary command buffer is graphics only we don't + * need to re-emit the current compute pipeline. + */ + if (secondary->state.emitted_compute_pipeline) { + primary->state.emitted_compute_pipeline = + secondary->state.emitted_compute_pipeline; + } + primary->state.last_primitive_reset_en = secondary->state.last_primitive_reset_en; primary->state.last_primitive_reset_index = secondary->state.last_primitive_reset_index; } |