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 <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18567>
This commit is contained in:
Samuel Pitoiset
2022-09-13 09:21:17 +02:00
committed by Marge Bot
parent 9ebaa62a34
commit 3cceaaf5cd
+6 -2
View File
@@ -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;