summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGPUCode <geoster3d@gmail.com>2023-07-01 14:19:31 +0200
committerGPUCode <geoster3d@gmail.com>2023-07-01 15:03:35 +0200
commit272916eeaf91f2430104b5454d765f762aa22cdc (patch)
treefa10f02646c4078b7256e738790f2238eeba5609 /src
parentrenderer_vulkan: Add support for VK_KHR_image_format_list (diff)
downloadyuzu-272916eeaf91f2430104b5454d765f762aa22cdc.tar
yuzu-272916eeaf91f2430104b5454d765f762aa22cdc.tar.gz
yuzu-272916eeaf91f2430104b5454d765f762aa22cdc.tar.bz2
yuzu-272916eeaf91f2430104b5454d765f762aa22cdc.tar.lz
yuzu-272916eeaf91f2430104b5454d765f762aa22cdc.tar.xz
yuzu-272916eeaf91f2430104b5454d765f762aa22cdc.tar.zst
yuzu-272916eeaf91f2430104b5454d765f762aa22cdc.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/compatible_formats.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/video_core/compatible_formats.cpp b/src/video_core/compatible_formats.cpp
index ab4f4d407..87d69ebc5 100644
--- a/src/video_core/compatible_formats.cpp
+++ b/src/video_core/compatible_formats.cpp
@@ -272,6 +272,9 @@ constexpr Table MakeNonNativeBgrCopyTable() {
bool IsViewCompatible(PixelFormat format_a, PixelFormat format_b, bool broken_views,
bool native_bgr) {
+ if (format_a == format_b) {
+ return true;
+ }
if (broken_views) {
// If format views are broken, only accept formats that are identical.
return format_a == format_b;
@@ -282,6 +285,9 @@ bool IsViewCompatible(PixelFormat format_a, PixelFormat format_b, bool broken_vi
}
bool IsCopyCompatible(PixelFormat format_a, PixelFormat format_b, bool native_bgr) {
+ if (format_a == format_b) {
+ return true;
+ }
static constexpr Table BGR_TABLE = MakeNativeBgrCopyTable();
static constexpr Table NO_BGR_TABLE = MakeNonNativeBgrCopyTable();
return IsSupported(native_bgr ? BGR_TABLE : NO_BGR_TABLE, format_a, format_b);
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index f1b696e01..3aac3cfab 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -826,9 +826,8 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched
}
for (size_t index_a = 0; index_a < VideoCore::Surface::MaxPixelFormat; index_a++) {
const auto image_format = static_cast<PixelFormat>(index_a);
- const auto type_a = VideoCore::Surface::GetFormatType(image_format);
- if (type_a != SurfaceType::ColorTexture) {
- continue;
+ if (IsPixelFormatASTC(image_format) && !device.IsOptimalAstcSupported()) {
+ view_formats[index_a].push_back(VK_FORMAT_A8B8G8R8_UNORM_PACK32);
}
for (size_t index_b = 0; index_b < VideoCore::Surface::MaxPixelFormat; index_b++) {
const auto view_format = static_cast<PixelFormat>(index_b);