summaryrefslogtreecommitdiffstats
path: root/src/video_core/buffer_cache/word_manager.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2023-05-04 13:23:36 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-05-07 23:46:12 +0200
commit36c302fa32b475abb1b211934eab14fe0cad936a (patch)
tree15403930756191fe3bdae622a4665b56caa2f4e5 /src/video_core/buffer_cache/word_manager.h
parentAddress feedback, add CR notice, etc (diff)
downloadyuzu-36c302fa32b475abb1b211934eab14fe0cad936a.tar
yuzu-36c302fa32b475abb1b211934eab14fe0cad936a.tar.gz
yuzu-36c302fa32b475abb1b211934eab14fe0cad936a.tar.bz2
yuzu-36c302fa32b475abb1b211934eab14fe0cad936a.tar.lz
yuzu-36c302fa32b475abb1b211934eab14fe0cad936a.tar.xz
yuzu-36c302fa32b475abb1b211934eab14fe0cad936a.tar.zst
yuzu-36c302fa32b475abb1b211934eab14fe0cad936a.zip
Diffstat (limited to 'src/video_core/buffer_cache/word_manager.h')
-rw-r--r--src/video_core/buffer_cache/word_manager.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/buffer_cache/word_manager.h b/src/video_core/buffer_cache/word_manager.h
index 0fb199a54..a336bde41 100644
--- a/src/video_core/buffer_cache/word_manager.h
+++ b/src/video_core/buffer_cache/word_manager.h
@@ -302,6 +302,9 @@ public:
(pending_pointer - pending_offset) * BYTES_PER_PAGE);
};
IterateWords(offset, size, [&](size_t index, u64 mask) {
+ if constexpr (type == Type::GPU) {
+ mask &= ~untracked_words[index];
+ }
const u64 word = state_words[index] & mask;
if constexpr (clear) {
if constexpr (type == Type::CPU || type == Type::CachedCPU) {
@@ -350,8 +353,13 @@ public:
static_assert(type != Type::Untracked);
const std::span<const u64> state_words = words.template Span<type>();
+ [[maybe_unused]] const std::span<const u64> untracked_words =
+ words.template Span<Type::Untracked>();
bool result = false;
IterateWords(offset, size, [&](size_t index, u64 mask) {
+ if constexpr (type == Type::GPU) {
+ mask &= ~untracked_words[index];
+ }
const u64 word = state_words[index] & mask;
if (word != 0) {
result = true;
@@ -372,9 +380,14 @@ public:
[[nodiscard]] std::pair<u64, u64> ModifiedRegion(u64 offset, u64 size) const noexcept {
static_assert(type != Type::Untracked);
const std::span<const u64> state_words = words.template Span<type>();
+ [[maybe_unused]] const std::span<const u64> untracked_words =
+ words.template Span<Type::Untracked>();
u64 begin = std::numeric_limits<u64>::max();
u64 end = 0;
IterateWords(offset, size, [&](size_t index, u64 mask) {
+ if constexpr (type == Type::GPU) {
+ mask &= ~untracked_words[index];
+ }
const u64 word = state_words[index] & mask;
if (word == 0) {
return;