From 3cceaaf5cd2ecc43c6d7b8f0214ef31b3acc8e82 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 13 Sep 2022 09:21:17 +0200 Subject: [PATCH] radv: do not bind NULL graphics pipeline when restoring the meta state It's invalid to bind NULL pipelines, but make sure to reset it to its previous NULL state. Signed-off-by: Samuel Pitoiset Reviewed-By: Mike Blumenkrantz Part-of: --- src/amd/vulkan/radv_meta.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index 13dbeaabdb0..6e57022cbb5 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -145,8 +145,12 @@ radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buf : VK_PIPELINE_BIND_POINT_COMPUTE; if (state->flags & RADV_META_SAVE_GRAPHICS_PIPELINE) { - radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_GRAPHICS, - radv_pipeline_to_handle(&state->old_graphics_pipeline->base)); + if (state->old_graphics_pipeline) { + radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_GRAPHICS, + radv_pipeline_to_handle(&state->old_graphics_pipeline->base)); + } else { + cmd_buffer->state.graphics_pipeline = NULL; + } cmd_buffer->state.dirty |= RADV_CMD_DIRTY_PIPELINE;