From 26f6458c70c265d4a3f29d437fd395bbaa5e3029 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:11:54 -0600 Subject: [PATCH] nvk/meta: Save and restore VI state Part-of: --- src/nouveau/vulkan/nvk_cmd_meta.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nouveau/vulkan/nvk_cmd_meta.c b/src/nouveau/vulkan/nvk_cmd_meta.c index a8f4aa1..a363fd8 100644 --- a/src/nouveau/vulkan/nvk_cmd_meta.c +++ b/src/nouveau/vulkan/nvk_cmd_meta.c @@ -42,6 +42,7 @@ nvk_device_finish_meta(struct nvk_device *dev) } struct nvk_meta_save { + struct vk_vertex_input_state _dynamic_vi; struct vk_dynamic_graphics_state dynamic; struct nvk_graphics_pipeline *pipeline; struct nvk_addr_range vb0; @@ -53,6 +54,8 @@ nvk_meta_begin(struct nvk_cmd_buffer *cmd, struct nvk_meta_save *save) { save->dynamic = cmd->vk.dynamic_graphics_state; + save->_dynamic_vi = cmd->state.gfx._dynamic_vi; + save->pipeline = cmd->state.gfx.pipeline; save->vb0 = cmd->state.gfx.vb0; @@ -81,7 +84,9 @@ nvk_meta_end(struct nvk_cmd_buffer *cmd, struct nvk_meta_save *save) { /* Restore the dynamic state */ + assert(save->dynamic.vi == &cmd->state.gfx._dynamic_vi); cmd->vk.dynamic_graphics_state = save->dynamic; + cmd->state.gfx._dynamic_vi = save->_dynamic_vi; memcpy(cmd->vk.dynamic_graphics_state.dirty, cmd->vk.dynamic_graphics_state.set, sizeof(cmd->vk.dynamic_graphics_state.set)); -- 2.7.4