diff options
author | Jason Ekstrand <[email protected]> | 2016-05-20 00:11:32 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-27 15:18:04 -0700 |
commit | b26bd6790dd1b09e377bd926e9145ec20ce6ac3f (patch) | |
tree | 4946fedb2023a1a3a4f2e2f12b1fa43e6c825658 | |
parent | 54324877926caa28b8ebd89d95b4e7c2447d17b8 (diff) |
anv/clear: Only clear the render area when doing subpass clears
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r-- | src/intel/vulkan/anv_meta_clear.c | 5 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 1 | ||||
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_meta_clear.c b/src/intel/vulkan/anv_meta_clear.c index eb4e56984c3..87f3733e81a 100644 --- a/src/intel/vulkan/anv_meta_clear.c +++ b/src/intel/vulkan/anv_meta_clear.c @@ -709,10 +709,7 @@ anv_cmd_buffer_clear_subpass(struct anv_cmd_buffer *cmd_buffer) anv_finishme("clearing multi-layer framebuffer"); VkClearRect clear_rect = { - .rect = { - .offset = { 0, 0 }, - .extent = { fb->width, fb->height }, - }, + .rect = cmd_state->render_area, .baseArrayLayer = 0, .layerCount = 1, /* FINISHME: clear multi-layer framebuffer */ }; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index d8fffc3bf6d..f6ce31da1c4 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1174,6 +1174,7 @@ struct anv_cmd_state { struct anv_framebuffer * framebuffer; struct anv_render_pass * pass; struct anv_subpass * subpass; + VkRect2D render_area; uint32_t restart_index; struct anv_vertex_binding vertex_bindings[MAX_VBS]; struct anv_descriptor_set * descriptors[MAX_SETS]; diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index f5e3530b59d..9f61a10c3ef 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1100,6 +1100,7 @@ void genX(CmdBeginRenderPass)( cmd_buffer->state.framebuffer = framebuffer; cmd_buffer->state.pass = pass; + cmd_buffer->state.render_area = pRenderPassBegin->renderArea; anv_cmd_state_setup_attachments(cmd_buffer, pRenderPassBegin); genX(flush_pipeline_select_3d)(cmd_buffer); |