|
|
|
@ -2029,15 +2029,24 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI |
|
|
|
} |
|
|
|
} |
|
|
|
const auto format_info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format); |
|
|
|
if (ImageUsageFlags(format_info, format) != image.UsageFlags()) { |
|
|
|
LOG_WARNING(Render_Vulkan, |
|
|
|
"Image view format {} has different usage flags than image format {}", format, |
|
|
|
image.info.format); |
|
|
|
// Ensure the view only exposes usage flags also supported by the backing image.
|
|
|
|
const VkImageUsageFlags view_usage = ImageUsageFlags(format_info, format); |
|
|
|
const VkImageUsageFlags image_usage = image.UsageFlags(); |
|
|
|
const VkImageUsageFlags unsupported_usage = view_usage & ~image_usage; |
|
|
|
const VkImageUsageFlags sanitized_usage = view_usage & image_usage; |
|
|
|
ASSERT_MSG(sanitized_usage != 0, |
|
|
|
"No compatible usage flags between view format {} and image format {}", format, |
|
|
|
image.info.format); |
|
|
|
if (unsupported_usage != 0) { |
|
|
|
LOG_DEBUG(Render_Vulkan, |
|
|
|
"Image view format {} requested usage flags {:08X} not supported by image format " |
|
|
|
"{}; dropping them", |
|
|
|
format, unsupported_usage, image.info.format); |
|
|
|
} |
|
|
|
const VkImageViewUsageCreateInfo image_view_usage{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
.usage = ImageUsageFlags(format_info, format), |
|
|
|
.usage = sanitized_usage, |
|
|
|
}; |
|
|
|
const VkImageViewCreateInfo create_info{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, |
|
|
|
|