nvk/meta: Save and restore VI state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
committed by
Marge Bot
parent
e824cdc0e5
commit
26f6458c70
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user