anv/clear: Only clear the render area when doing subpass clears
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 20 May 2016 07:11:32 +0000 (00:11 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 27 May 2016 22:18:04 +0000 (15:18 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/intel/vulkan/anv_meta_clear.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_cmd_buffer.c

index eb4e56984c35659388fdb5d423f4c5870fdf63ad..87f3733e81a39b0de7e83cd4f210e0b79f61d0a7 100644 (file)
@@ -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 */
    };
index d8fffc3bf6d9000fc6559171845f96c24f32909a..f6ce31da1c4643858c70ac2838ed18b43e0766b5 100644 (file)
@@ -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];
index f5e3530b59d5ac04c113be917b85485bff2b28d6..9f61a10c3efa4019b357671da94cc0a833df3d7e 100644 (file)
@@ -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);