yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

vk_texture_cache: Fix unsupported blit format error checking

This commit is contained in:
ameerj 2021-10-07 02:15:16 -04:00 committed by Fernando Sahmkow
parent f8339cd703
commit 89a7e566c7
2 changed files with 9 additions and 9 deletions

View File

@ -1137,11 +1137,11 @@ bool Image::ScaleUp() {
const auto& device = runtime->device; const auto& device = runtime->device;
const PixelFormat format = StorageFormat(info.format); const PixelFormat format = StorageFormat(info.format);
const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format); const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format);
const auto similar = device.GetSupportedFormat( const auto blit_usage = VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT;
format_info.format, (VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT), if (!device.IsFormatSupported(format_info.format, blit_usage, FormatType::Optimal)) {
FormatType::Optimal); LOG_ERROR(Render_Vulkan, "Device does not support scaling format {}", format);
if (similar != format_info.format) { // TODO: Use helper blits where applicable
return true; return false;
} }
if (!scaled_image) { if (!scaled_image) {
const u32 up = resolution.up_scale; const u32 up = resolution.up_scale;

View File

@ -40,6 +40,10 @@ public:
VkFormat GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, VkFormat GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage,
FormatType format_type) const; FormatType format_type) const;
/// Returns true if a format is supported.
bool IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage,
FormatType format_type) const;
/// Reports a device loss. /// Reports a device loss.
void ReportLoss() const; void ReportLoss() const;
@ -370,10 +374,6 @@ private:
/// Returns true if the device natively supports blitting depth stencil images. /// Returns true if the device natively supports blitting depth stencil images.
bool TestDepthStencilBlits() const; bool TestDepthStencilBlits() const;
/// Returns true if a format is supported.
bool IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage,
FormatType format_type) const;
VkInstance instance; ///< Vulkan instance. VkInstance instance; ///< Vulkan instance.
vk::DeviceDispatch dld; ///< Device function pointers. vk::DeviceDispatch dld; ///< Device function pointers.
vk::PhysicalDevice physical; ///< Physical device. vk::PhysicalDevice physical; ///< Physical device.