From: Jason Ekstrand Date: Sat, 21 Nov 2015 08:04:57 +0000 (-0800) Subject: anv/meta_clear: Don't try to clear depth-stencil without LOAD_OP_CLEAR X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83c305f8efc019151f8cabaca0114bfcace096ef;p=mesa.git anv/meta_clear: Don't try to clear depth-stencil without LOAD_OP_CLEAR --- diff --git a/src/vulkan/anv_meta_clear.c b/src/vulkan/anv_meta_clear.c index 7eb4c5587cc..16e15c67cc9 100644 --- a/src/vulkan/anv_meta_clear.c +++ b/src/vulkan/anv_meta_clear.c @@ -629,20 +629,22 @@ anv_cmd_buffer_clear_attachments(struct anv_cmd_buffer *cmd_buffer, emit_load_color_clear(cmd_buffer, a, clear_values[a].color); } } else { - VkImageAspectFlags aspects = 0; + VkImageAspectFlags clear_aspects = 0; if (att->format->depth_format && att->load_op == VK_ATTACHMENT_LOAD_OP_CLEAR) { - aspects |= VK_IMAGE_ASPECT_DEPTH_BIT; + clear_aspects |= VK_IMAGE_ASPECT_DEPTH_BIT; } if (att->format->has_stencil && att->stencil_load_op == VK_ATTACHMENT_LOAD_OP_CLEAR) { - aspects |= VK_IMAGE_ASPECT_STENCIL_BIT; + clear_aspects |= VK_IMAGE_ASPECT_STENCIL_BIT; } - emit_load_depthstencil_clear(cmd_buffer, a, aspects, - clear_values[a].depthStencil); + if (clear_aspects) { + emit_load_depthstencil_clear(cmd_buffer, a, clear_aspects, + clear_values[a].depthStencil); + } } }