diff options
author | Jason Ekstrand <[email protected]> | 2015-11-21 00:04:57 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-11-21 00:05:18 -0800 |
commit | 83c305f8efc019151f8cabaca0114bfcace096ef (patch) | |
tree | 93b6b39512396b055c4de87118a41963a700488b | |
parent | 438eaa3ae7f7c79c4362c8900195a1ddeceb1ab0 (diff) |
anv/meta_clear: Don't try to clear depth-stencil without LOAD_OP_CLEAR
-rw-r--r-- | src/vulkan/anv_meta_clear.c | 12 |
1 files changed, 7 insertions, 5 deletions
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); + } } } |