diff options
author | Jason Ekstrand <[email protected]> | 2016-06-15 14:30:07 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-07-09 20:58:33 -0700 |
commit | adbed7ae7acb2a5dd6f188c5f903fbe0ca415fa8 (patch) | |
tree | 8e6f7616e3ee45cfab93cdf00fa9e42eaf44c7c4 /src/intel/vulkan/anv_dump.c | |
parent | a26cda5ca524677148d796318e31ddbf093531a2 (diff) |
anv/dump: Use anv_minify instead of hand-rolling it
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_dump.c')
-rw-r--r-- | src/intel/vulkan/anv_dump.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_dump.c b/src/intel/vulkan/anv_dump.c index 307e501a593..ffb892c17ac 100644 --- a/src/intel/vulkan/anv_dump.c +++ b/src/intel/vulkan/anv_dump.c @@ -36,11 +36,10 @@ anv_dump_image_to_ppm(struct anv_device *device, VkDevice vk_device = anv_device_to_handle(device); MAYBE_UNUSED VkResult result; - VkExtent2D extent = { image->extent.width, image->extent.height }; - for (unsigned i = 0; i < miplevel; i++) { - extent.width = MAX2(1, extent.width / 2); - extent.height = MAX2(1, extent.height / 2); - } + VkExtent2D extent = { + anv_minify(image->extent.width, miplevel), + anv_minify(image->extent.height, miplevel), + }; VkImage copy_image; result = anv_CreateImage(vk_device, |