diff options
author | Chad Versace <[email protected]> | 2016-01-27 20:13:10 -0800 |
---|---|---|
committer | Chad Versace <[email protected]> | 2016-01-28 10:03:00 -0800 |
commit | 3d863e8dadcc3c2d21d7ecf9219c9255d6a2f949 (patch) | |
tree | 7ff4bf78e50022c682905057b2c3e75e0e9b52e3 /src | |
parent | 8487569fa7839d9646ef92b8b64b0e249f6efcae (diff) |
anv/meta_resolve: Save/Restore viewport and scissor
Diffstat (limited to 'src')
-rw-r--r-- | src/vulkan/anv_meta_resolve.c | 23 |
1 files 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); } |