summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-05-20 23:15:36 +0200
committerLiam <byteslice@airmail.cc>2023-05-23 18:54:40 +0200
commit415c78b87c008f0d963679ea9bc06c8aa566b506 (patch)
tree11e6a5d2211a99660a48678059c703e849c06da3 /src/video_core/renderer_vulkan/maxwell_to_vk.cpp
parentMerge pull request #10392 from danilaml/update-cubeb-again (diff)
downloadyuzu-415c78b87c008f0d963679ea9bc06c8aa566b506.tar
yuzu-415c78b87c008f0d963679ea9bc06c8aa566b506.tar.gz
yuzu-415c78b87c008f0d963679ea9bc06c8aa566b506.tar.bz2
yuzu-415c78b87c008f0d963679ea9bc06c8aa566b506.tar.lz
yuzu-415c78b87c008f0d963679ea9bc06c8aa566b506.tar.xz
yuzu-415c78b87c008f0d963679ea9bc06c8aa566b506.tar.zst
yuzu-415c78b87c008f0d963679ea9bc06c8aa566b506.zip
Diffstat (limited to 'src/video_core/renderer_vulkan/maxwell_to_vk.cpp')
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 8853cf0f7..b75d7220d 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -6,6 +6,7 @@
#include "common/assert.h"
#include "common/common_types.h"
#include "common/logging/log.h"
+#include "common/settings.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/renderer_vulkan/maxwell_to_vk.h"
#include "video_core/surface.h"
@@ -237,14 +238,25 @@ FormatInfo SurfaceFormat(const Device& device, FormatType format_type, bool with
PixelFormat pixel_format) {
ASSERT(static_cast<size_t>(pixel_format) < std::size(tex_format_tuples));
FormatTuple tuple = tex_format_tuples[static_cast<size_t>(pixel_format)];
- // Use A8B8G8R8_UNORM on hardware that doesn't support ASTC natively
+ // Transcode on hardware that doesn't support ASTC natively
if (!device.IsOptimalAstcSupported() && VideoCore::Surface::IsPixelFormatASTC(pixel_format)) {
const bool is_srgb = with_srgb && VideoCore::Surface::IsPixelFormatSRGB(pixel_format);
- if (is_srgb) {
- tuple.format = VK_FORMAT_A8B8G8R8_SRGB_PACK32;
- } else {
- tuple.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32;
- tuple.usage |= Storage;
+
+ switch (Settings::values.astc_recompression.GetValue()) {
+ case Settings::AstcRecompression::Uncompressed:
+ if (is_srgb) {
+ tuple.format = VK_FORMAT_A8B8G8R8_SRGB_PACK32;
+ } else {
+ tuple.format = VK_FORMAT_A8B8G8R8_UNORM_PACK32;
+ tuple.usage |= Storage;
+ }
+ break;
+ case Settings::AstcRecompression::Bc1:
+ tuple.format = is_srgb ? VK_FORMAT_BC1_RGBA_SRGB_BLOCK : VK_FORMAT_BC1_RGBA_UNORM_BLOCK;
+ break;
+ case Settings::AstcRecompression::Bc3:
+ tuple.format = is_srgb ? VK_FORMAT_BC3_SRGB_BLOCK : VK_FORMAT_BC3_UNORM_BLOCK;
+ break;
}
}
const bool attachable = (tuple.usage & Attachable) != 0;