summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2023-07-02 00:01:11 +0200
committercomex <comexk@gmail.com>2023-07-02 00:01:11 +0200
commit98685d48e3cb9f25f6919f004ec62cadf33afad2 (patch)
tree9df2ce7f57370641589bfae7196c77b090bcbe0f /src/video_core/renderer_vulkan/maxwell_to_vk.cpp
parentPR feedback + constification (diff)
parentUpdate translations (2023-07-01) (#10972) (diff)
downloadyuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar
yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar.gz
yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar.bz2
yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar.lz
yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar.xz
yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.tar.zst
yuzu-98685d48e3cb9f25f6919f004ec62cadf33afad2.zip
Diffstat (limited to 'src/video_core/renderer_vulkan/maxwell_to_vk.cpp')
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 9a0b10568..a8540339d 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -259,6 +259,26 @@ FormatInfo SurfaceFormat(const Device& device, FormatType format_type, bool with
break;
}
}
+ // Transcode on hardware that doesn't support BCn natively
+ if (!device.IsOptimalBcnSupported() && VideoCore::Surface::IsPixelFormatBCn(pixel_format)) {
+ const bool is_srgb = with_srgb && VideoCore::Surface::IsPixelFormatSRGB(pixel_format);
+ if (pixel_format == PixelFormat::BC4_SNORM) {
+ tuple.format = VK_FORMAT_R8_SNORM;
+ } else if (pixel_format == PixelFormat::BC4_UNORM) {
+ tuple.format = VK_FORMAT_R8_UNORM;
+ } else if (pixel_format == PixelFormat::BC5_SNORM) {
+ tuple.format = VK_FORMAT_R8G8_SNORM;
+ } else if (pixel_format == PixelFormat::BC5_UNORM) {
+ tuple.format = VK_FORMAT_R8G8_UNORM;
+ } else if (pixel_format == PixelFormat::BC6H_SFLOAT ||
+ pixel_format == PixelFormat::BC6H_UFLOAT) {
+ tuple.format = VK_FORMAT_R16G16B16A16_SFLOAT;
+ } else if (is_srgb) {
+ tuple.format = VK_FORMAT_A8B8G8R8_SRGB_PACK32;
+ } else {
+ tuple.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32;
+ }
+ }
const bool attachable = (tuple.usage & Attachable) != 0;
const bool storage = (tuple.usage & Storage) != 0;