[Mesa-dev] [PATCH 1/4] radv: be smarter with pipelines when emitting secondary buffers
Samuel Pitoiset
samuel.pitoiset at gmail.com
Wed Oct 11 14:25:57 UTC 2017
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/amd/vulkan/radv_cmd_buffer.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 73db9ec5ea..9d6fb9fe40 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -2661,8 +2661,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;
}
--
2.14.2
More information about the mesa-dev
mailing list