Skip to content

Commit

Permalink
Fix number of mip levels calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
panos-lunarg committed Oct 9, 2024
1 parent 6291285 commit 61ef5ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion framework/graphics/vulkan_resources_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,9 @@ VkResult VulkanResourcesUtil::ReadFromImageResourceStaging(VkImage
scaled_extent.height = std::max(scaled_extent.height * scale, 1.0f);

const uint32_t dst_img_mip_levels =
1 + floor(log2(std::max(std::max(scaled_extent.width, scaled_extent.height), scaled_extent.depth)));
src_img_mip_levels > 1
? 1 + floor(log2(std::max(std::max(scaled_extent.width, scaled_extent.height), scaled_extent.depth)))
: src_img_mip_levels;

resource_size = GetImageResourceSizesOptimal(image,
dst_format,
Expand Down

0 comments on commit 61ef5ce

Please sign in to comment.