From 3d863e8dadcc3c2d21d7ecf9219c9255d6a2f949 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Wed, 27 Jan 2016 20:13:10 -0800 Subject: [PATCH] anv/meta_resolve: Save/Restore viewport and scissor --- src/vulkan/anv_meta_resolve.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/vulkan/anv_meta_resolve.c b/src/vulkan/anv_meta_resolve.c index be8407869c8..1be87c4c198 100644 --- a/src/vulkan/anv_meta_resolve.c +++ b/src/vulkan/anv_meta_resolve.c @@ -37,6 +37,25 @@ struct vertex_attrs { float tex_position[2]; }; +static void +meta_resolve_save(struct anv_meta_saved_state *saved_state, + struct anv_cmd_buffer *cmd_buffer) +{ + anv_meta_save(saved_state, cmd_buffer, + (1 << VK_DYNAMIC_STATE_VIEWPORT) | + (1 << VK_DYNAMIC_STATE_SCISSOR)); + + cmd_buffer->state.dynamic.viewport.count = 0; + cmd_buffer->state.dynamic.scissor.count = 0; +} + +static void +meta_resolve_restore(struct anv_meta_saved_state *saved_state, + struct anv_cmd_buffer *cmd_buffer) +{ + anv_meta_restore(saved_state, cmd_buffer); +} + static nir_shader * build_nir_vs(void) { @@ -643,7 +662,7 @@ void anv_CmdResolveImage( struct anv_meta_saved_state state; VkDevice device_h = anv_device_to_handle(device); - anv_meta_save(&state, cmd_buffer, 0); + meta_resolve_save(&state, cmd_buffer); assert(src_image->samples > 1); assert(dest_image->samples == 1); @@ -780,5 +799,5 @@ void anv_CmdResolveImage( } } - anv_meta_restore(&state, cmd_buffer); + meta_resolve_restore(&state, cmd_buffer); } -- 2.30.2