diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index 3e5e13bde..ed18516a1 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp @@ -127,14 +127,18 @@ ImageInfo::ImageInfo(const AmdGpu::Image& image, const Shader::ImageResource& de tiling_mode = image.GetTilingMode(); pixel_format = LiverpoolToVK::SurfaceFormat(image.GetDataFmt(), image.GetNumberFmt()); // Override format if image is forced to be a depth target, except if the image is a dummy one - if (desc.is_depth && (image.width != 0 && image.height != 0)) { - pixel_format = Vulkan::LiverpoolToVK::PromoteFormatToDepth(pixel_format); - if (pixel_format == vk::Format::eUndefined) { - ASSERT_MSG( - image.width == 0 && image.height == 0, - "PromoteFormatToDepth failed, info dump: format: {}, size: {}x{}, data_format: {}", - vk::to_string(pixel_format), image.width, image.height, - AmdGpu::NameOf(image.GetDataFmt())); + if (desc.is_depth) { + if (image.width != 0 && image.height != 0) { + pixel_format = Vulkan::LiverpoolToVK::PromoteFormatToDepth(pixel_format); + if (pixel_format == vk::Format::eUndefined) { + ASSERT_MSG(image.width == 0 && image.height == 0, + "PromoteFormatToDepth failed, info dump: format: {}, size: {}x{}, " + "data_format: {}", + vk::to_string(pixel_format), image.width, image.height, + AmdGpu::NameOf(image.GetDataFmt())); + pixel_format = vk::Format::eD32Sfloat; + } + } else { pixel_format = vk::Format::eD32Sfloat; } } diff --git a/src/video_core/texture_cache/image_view.cpp b/src/video_core/texture_cache/image_view.cpp index e47d7006e..84aaddb86 100644 --- a/src/video_core/texture_cache/image_view.cpp +++ b/src/video_core/texture_cache/image_view.cpp @@ -38,14 +38,18 @@ ImageViewInfo::ImageViewInfo(const AmdGpu::Image& image, const Shader::ImageReso } format = Vulkan::LiverpoolToVK::SurfaceFormat(dfmt, nfmt); // Override format if image is forced to be a depth target, except if the image is a dummy one - if (desc.is_depth && (image.width != 0 && image.height != 0)) { - format = Vulkan::LiverpoolToVK::PromoteFormatToDepth(format); - if (format == vk::Format::eUndefined) { - ASSERT_MSG( - image.width == 0 && image.height == 0, - "PromoteFormatToDepth failed, info dump: format: {}, size: {}x{}, data_format: {}", - vk::to_string(format), image.width, image.height, - AmdGpu::NameOf(image.GetDataFmt())); + if (desc.is_depth) { + if (image.width != 0 && image.height != 0) { + format = Vulkan::LiverpoolToVK::PromoteFormatToDepth(format); + if (format == vk::Format::eUndefined) { + ASSERT_MSG(image.width == 0 && image.height == 0, + "PromoteFormatToDepth failed, info dump: format: {}, size: {}x{}, " + "data_format: {}", + vk::to_string(format), image.width, image.height, + AmdGpu::NameOf(image.GetDataFmt())); + format = vk::Format::eD32Sfloat; + } + } else { format = vk::Format::eD32Sfloat; } }