diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp index 9a2d16a6e..e1b8aa8ad 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/surface_load_store.cpp | |||
| @@ -61,18 +61,19 @@ enum class Clamp : u64 { | |||
| 61 | TRAP, | 61 | TRAP, |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | // https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#cache-operators | ||
| 64 | enum class LoadCache : u64 { | 65 | enum class LoadCache : u64 { |
| 65 | Default, | 66 | CA, // Cache at all levels, likely to be accessed again |
| 66 | CG, | 67 | CG, // Cache at global level (L2 and below, not L1) |
| 67 | CI, | 68 | CI, // ??? |
| 68 | CV, | 69 | CV, // Don't cache and fetch again (volatile) |
| 69 | }; | 70 | }; |
| 70 | 71 | ||
| 71 | enum class StoreCache : u64 { | 72 | enum class StoreCache : u64 { |
| 72 | Default, | 73 | WB, // Cache write-back all coherent levels |
| 73 | CG, | 74 | CG, // Cache at global level (L2 and below, not L1) |
| 74 | CS, | 75 | CS, // Cache streaming, likely to be accessed once |
| 75 | WT, | 76 | WT, // Cache write-through (to system memory, volatile?) |
| 76 | }; | 77 | }; |
| 77 | 78 | ||
| 78 | ImageFormat Format(Size size) { | 79 | ImageFormat Format(Size size) { |
| @@ -188,7 +189,7 @@ void TranslatorVisitor::SULD(u64 insn) { | |||
| 188 | if (suld.clamp != Clamp::IGN) { | 189 | if (suld.clamp != Clamp::IGN) { |
| 189 | throw NotImplementedException("Clamp {}", suld.clamp.Value()); | 190 | throw NotImplementedException("Clamp {}", suld.clamp.Value()); |
| 190 | } | 191 | } |
| 191 | if (suld.cache != LoadCache::Default) { | 192 | if (suld.cache != LoadCache::CA && suld.cache != LoadCache::CG) { |
| 192 | throw NotImplementedException("Cache {}", suld.cache.Value()); | 193 | throw NotImplementedException("Cache {}", suld.cache.Value()); |
| 193 | } | 194 | } |
| 194 | const bool is_typed{suld.d != 0}; | 195 | const bool is_typed{suld.d != 0}; |
| @@ -248,7 +249,7 @@ void TranslatorVisitor::SUST(u64 insn) { | |||
| 248 | if (sust.clamp != Clamp::IGN) { | 249 | if (sust.clamp != Clamp::IGN) { |
| 249 | throw NotImplementedException("Clamp {}", sust.clamp.Value()); | 250 | throw NotImplementedException("Clamp {}", sust.clamp.Value()); |
| 250 | } | 251 | } |
| 251 | if (sust.cache != StoreCache::Default) { | 252 | if (sust.cache != StoreCache::WB && sust.cache != StoreCache::CG) { |
| 252 | throw NotImplementedException("Cache {}", sust.cache.Value()); | 253 | throw NotImplementedException("Cache {}", sust.cache.Value()); |
| 253 | } | 254 | } |
| 254 | const bool is_typed{sust.d != 0}; | 255 | const bool is_typed{sust.d != 0}; |