summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_meta_clear.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-01-19 15:52:03 -0800
committerJason Ekstrand <[email protected]>2016-01-19 16:53:35 -0800
commit46eef313119f0d08e674ee7f6f9934e75303892b (patch)
treeb7f1fd3d438d7844a8b8b4fb9a7f864d58e40cb4 /src/vulkan/anv_meta_clear.c
parent6325a750111ff19e263e8fe0f1c82818a42f0f7d (diff)
anv/meta_clear: Call emit_clear directly in ClearImage
Using the load op means that we end up with recursive meta. We shouldn't be doing that.
Diffstat (limited to 'src/vulkan/anv_meta_clear.c')
-rw-r--r--src/vulkan/anv_meta_clear.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/vulkan/anv_meta_clear.c b/src/vulkan/anv_meta_clear.c
index b5e257b1602..1bc470fb5de 100644
--- a/src/vulkan/anv_meta_clear.c
+++ b/src/vulkan/anv_meta_clear.c
@@ -888,18 +888,9 @@ anv_cmd_clear_image(struct anv_cmd_buffer *cmd_buffer,
};
if (range->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) {
- att_desc.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
-
subpass_desc.colorAttachmentCount = 1;
subpass_desc.pColorAttachments = &att_ref;
} else {
- if (range->aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) {
- att_desc.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
- }
- if (range->aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) {
- att_desc.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
- }
-
subpass_desc.pDepthStencilAttachment = &att_ref;
}
@@ -927,11 +918,28 @@ anv_cmd_clear_image(struct anv_cmd_buffer *cmd_buffer,
},
.renderPass = pass,
.framebuffer = fb,
- .clearValueCount = 1,
- .pClearValues = clear_value,
+ .clearValueCount = 0,
+ .pClearValues = NULL,
},
VK_SUBPASS_CONTENTS_INLINE);
+ VkClearAttachment clear_att = {
+ .aspectMask = range->aspectMask,
+ .colorAttachment = 0,
+ .clearValue = *clear_value,
+ };
+
+ VkClearRect clear_rect = {
+ .rect = {
+ .offset = { 0, 0 },
+ .extent = { iview.extent.width, iview.extent.height },
+ },
+ .baseArrayLayer = range->baseArrayLayer,
+ .layerCount = 1, /* FINISHME: clear multi-layer framebuffer */
+ };
+
+ emit_clear(cmd_buffer, &clear_att, &clear_rect);
+
ANV_CALL(CmdEndRenderPass)(anv_cmd_buffer_to_handle(cmd_buffer));
ANV_CALL(DestroyRenderPass)(device_h, pass,
&cmd_buffer->pool->alloc);