summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-06-14 21:41:28 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-21 02:38:34 +0200
commit03d489dcf5dbe13dff1ff788c609f964dd24019c (patch)
treec0de7fa6a187b9cd4fa83f282ee17e92a784334b /src/video_core/texture_cache
parentgl_texture_cache: Use Stream Buffers instead of Persistant for Buffer Copies. (diff)
downloadyuzu-03d489dcf5dbe13dff1ff788c609f964dd24019c.tar
yuzu-03d489dcf5dbe13dff1ff788c609f964dd24019c.tar.gz
yuzu-03d489dcf5dbe13dff1ff788c609f964dd24019c.tar.bz2
yuzu-03d489dcf5dbe13dff1ff788c609f964dd24019c.tar.lz
yuzu-03d489dcf5dbe13dff1ff788c609f964dd24019c.tar.xz
yuzu-03d489dcf5dbe13dff1ff788c609f964dd24019c.tar.zst
yuzu-03d489dcf5dbe13dff1ff788c609f964dd24019c.zip
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/texture_cache.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 7a9b4c27d..8213f434d 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -227,12 +227,18 @@ protected:
}
SetEmptyDepthBuffer();
staging_cache.SetSize(2);
- siblings_table[PixelFormat::Z16] = PixelFormat::R16F;
- siblings_table[PixelFormat::Z32F] = PixelFormat::R32F;
- siblings_table[PixelFormat::Z32FS8] = PixelFormat::RG32F;
- siblings_table[PixelFormat::R16F] = PixelFormat::Z16;
- siblings_table[PixelFormat::R32F] = PixelFormat::Z32F;
- siblings_table[PixelFormat::RG32F] = PixelFormat::Z32FS8;
+ auto make_siblings = ([this](PixelFormat a, PixelFormat b) {
+ siblings_table[a] = b;
+ siblings_table[b] = a;
+ });
+ const u32 max_formats = static_cast<u32>(PixelFormat::Max);
+ siblings_table.reserve(max_formats);
+ for (u32 i = 0; i < max_formats; i++) {
+ siblings_table[static_cast<PixelFormat>(i)] = PixelFormat::Invalid;
+ }
+ make_siblings(PixelFormat::Z16, PixelFormat::R16F);
+ make_siblings(PixelFormat::Z32F, PixelFormat::R32F);
+ make_siblings(PixelFormat::Z32FS8, PixelFormat::RG32F);
}
~TextureCache() = default;
@@ -766,6 +772,9 @@ private:
// Guards the cache for protection conflicts.
bool guard_cache{};
+ // The siblings table is for formats that can inter exchange with one another
+ // without causing issues. This is only valid when a conflict occurs on a non
+ // rendering use.
std::unordered_map<PixelFormat, PixelFormat> siblings_table;
// The internal Cache is different for the Texture Cache. It's based on buckets