From 86b8fa9aee888cfa3d9c09a0636bf8046cac79f9 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 19 Jan 2022 11:59:49 +0100 Subject: [PATCH] radv: do not restore NULL compute pipelines after meta operations This should be safe as long as the driver restores descriptors and push constants correctly for compute pipelines. This might also reduce the number of compute pipeline changes if eg. consecutve subpass fast clears with compute. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_meta.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index e49a414e272..f376a9e6562 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -219,8 +219,10 @@ radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buf } if (state->flags & RADV_META_SAVE_COMPUTE_PIPELINE) { - radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE, - radv_pipeline_to_handle(state->old_pipeline)); + if (state->old_pipeline) { + radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE, + radv_pipeline_to_handle(state->old_pipeline)); + } } if (state->flags & RADV_META_SAVE_DESCRIPTORS) {