This commit is contained in:
lizzie 2026-04-26 09:23:20 +00:00
parent 4d3812ea61
commit d3d61d6654

View file

@ -2139,8 +2139,8 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
.pNext = nullptr, .pNext = nullptr,
.usage = clamped_view_usage, .usage = clamped_view_usage,
}; };
SubresourceRange range = info.range; SubresourceRange ci_range = info.range;
range.extent.levels = (std::min)(range.extent.levels, s32(GetMaxMipLevel(image.info.size.width, image.info.size.height, image.info.size.depth))); ci_range.extent.levels = (std::min)(range.extent.levels, s32(GetMaxMipLevel(image.info.size.width, image.info.size.height, image.info.size.depth)));
const VkImageViewCreateInfo create_info{ const VkImageViewCreateInfo create_info{
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
.pNext = &image_view_usage, .pNext = &image_view_usage,
@ -2154,7 +2154,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
.b = ComponentSwizzle(swizzle[2]), .b = ComponentSwizzle(swizzle[2]),
.a = ComponentSwizzle(swizzle[3]), .a = ComponentSwizzle(swizzle[3]),
}, },
.subresourceRange = MakeSubresourceRange(aspect_mask, range), .subresourceRange = MakeSubresourceRange(aspect_mask, ci_range),
}; };
const auto create = [&](TextureType tex_type, std::optional<u32> num_layers) { const auto create = [&](TextureType tex_type, std::optional<u32> num_layers) {
VkImageViewCreateInfo ci{create_info}; VkImageViewCreateInfo ci{create_info};