diff options
author | Jason Ekstrand <[email protected]> | 2016-06-13 17:08:59 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-07-09 20:58:33 -0700 |
commit | a26cda5ca524677148d796318e31ddbf093531a2 (patch) | |
tree | ca3720d750a9f85213e2d1a4aabdfac76592a90a /src/intel/vulkan/anv_dump.c | |
parent | b479c47a9ce11048601c56c9e69222ad75c71458 (diff) |
anv/dump: Take an aspect in dump_image_to_ppm
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_dump.c')
-rw-r--r-- | src/intel/vulkan/anv_dump.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_dump.c b/src/intel/vulkan/anv_dump.c index 63ad2cd070a..307e501a593 100644 --- a/src/intel/vulkan/anv_dump.c +++ b/src/intel/vulkan/anv_dump.c @@ -30,7 +30,8 @@ void anv_dump_image_to_ppm(struct anv_device *device, struct anv_image *image, unsigned miplevel, - unsigned array_layer, const char *filename) + unsigned array_layer, VkImageAspectFlagBits aspect, + const char *filename) { VkDevice vk_device = anv_device_to_handle(device); MAYBE_UNUSED VkResult result; @@ -98,12 +99,15 @@ anv_dump_image_to_ppm(struct anv_device *device, }); assert(result == VK_SUCCESS); + VkImageUsageFlags old_usage = image->usage; + image->usage |= VK_IMAGE_USAGE_SAMPLED_BIT; + anv_CmdBlitImage(cmd, anv_image_to_handle(image), VK_IMAGE_LAYOUT_GENERAL, copy_image, VK_IMAGE_LAYOUT_GENERAL, 1, &(VkImageBlit) { .srcSubresource = { - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, + .aspectMask = aspect, .mipLevel = miplevel, .baseArrayLayer = array_layer, .layerCount = 1, @@ -124,6 +128,8 @@ anv_dump_image_to_ppm(struct anv_device *device, }, }, VK_FILTER_NEAREST); + image->usage = old_usage; + ANV_CALL(CmdPipelineBarrier)(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, |