Skip to content

Commit dc7df9e

Browse files
committed
[GPU] Fix scaled resolve tracking for blocks outside write range
1 parent f8fb490 commit dc7df9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/xenia/gpu/texture_cache.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,13 @@ void TextureCache::ScaledResolveGlobalWatchCallback(
10521052
uint32_t resolve_l2_block_last = resolve_block_last >> 6;
10531053
for (uint32_t i = resolve_l2_block_first; i <= resolve_l2_block_last; ++i) {
10541054
uint64_t resolve_l2_block = scaled_resolve_pages_l2_[i];
1055+
// Pre-mask to only process blocks within the write range.
1056+
if (i == resolve_l2_block_first) {
1057+
resolve_l2_block &= ~((UINT64_C(1) << (resolve_block_first & 63)) - 1);
1058+
}
1059+
if (i == resolve_l2_block_last && (resolve_block_last & 63) != 63) {
1060+
resolve_l2_block &= (UINT64_C(1) << ((resolve_block_last & 63) + 1)) - 1;
1061+
}
10551062
uint32_t resolve_block_relative_index;
10561063
while (
10571064
xe::bit_scan_forward(resolve_l2_block, &resolve_block_relative_index)) {

0 commit comments

Comments
 (0)