diff options
author | Jason Ekstrand <[email protected]> | 2016-05-31 11:26:06 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-06-03 19:29:28 -0700 |
commit | 59f06ac3892fefd55b8f1371b48f9e0d99cc7c23 (patch) | |
tree | 48f6551bae7a04cec3b97fa1d59aac9fa739be5a /src/intel/vulkan/anv_meta_clear.c | |
parent | 7244dc1e0651958b62222cafb15e34487851a6cd (diff) |
anv/clear: Handle ClearImage on 3-D images
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_meta_clear.c')
-rw-r--r-- | src/intel/vulkan/anv_meta_clear.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_meta_clear.c b/src/intel/vulkan/anv_meta_clear.c index 18dfae8817d..fe750c859f8 100644 --- a/src/intel/vulkan/anv_meta_clear.c +++ b/src/intel/vulkan/anv_meta_clear.c @@ -761,9 +761,11 @@ anv_cmd_clear_image(struct anv_cmd_buffer *cmd_buffer, for (uint32_t r = 0; r < range_count; r++) { const VkImageSubresourceRange *range = &ranges[r]; - for (uint32_t l = 0; l < anv_get_levelCount(image, range); ++l) { - for (uint32_t s = 0; s < anv_get_layerCount(image, range); ++s) { + const uint32_t layer_count = image->type == VK_IMAGE_TYPE_3D ? + anv_minify(image->extent.depth, l) : + anv_get_layerCount(image, range); + for (uint32_t s = 0; s < layer_count; ++s) { struct anv_image_view iview; anv_image_view_init(&iview, cmd_buffer->device, &(VkImageViewCreateInfo) { |