summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2021-07-07 15:11:15 +0200
committerGravatar Fernando Sahmkow2021-07-09 22:20:36 +0200
commit73638ca593fde989b069073db3d8a5a48203565b (patch)
tree946aa21fa07e10fd5f290112b401429eda298705 /src
parentFence Manager: Add fences on Reference Count. (diff)
downloadyuzu-73638ca593fde989b069073db3d8a5a48203565b.tar.gz
yuzu-73638ca593fde989b069073db3d8a5a48203565b.tar.xz
yuzu-73638ca593fde989b069073db3d8a5a48203565b.zip
Buffer Cache: Eliminate the AC Hack as the base game is fixed in Hades.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 3faa7e0d0..2bd86f215 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -586,9 +586,6 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
586 cpu_addr_base += u64(std::max<s64>(difference2, 0)); 586 cpu_addr_base += u64(std::max<s64>(difference2, 0));
587 const u64 new_size = cpu_addr_end2 - cpu_addr_base; 587 const u64 new_size = cpu_addr_end2 - cpu_addr_base;
588 const u64 new_offset = cpu_addr_base - buffer.CpuAddr(); 588 const u64 new_offset = cpu_addr_base - buffer.CpuAddr();
589 if (IsRegionCpuModified(cpu_addr_base, new_size)) {
590 return;
591 }
592 downloads.push_back({ 589 downloads.push_back({
593 BufferCopy{ 590 BufferCopy{
594 .src_offset = new_offset, 591 .src_offset = new_offset,
@@ -601,11 +598,11 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
601 largest_copy = std::max(largest_copy, new_size); 598 largest_copy = std::max(largest_copy, new_size);
602 constexpr u64 align_mask = ~(32ULL - 1); 599 constexpr u64 align_mask = ~(32ULL - 1);
603 const VAddr align_up_address = (cpu_addr_base + 31) & align_mask; 600 const VAddr align_up_address = (cpu_addr_base + 31) & align_mask;
604 const u64 difference = align_up_address - cpu_addr_base; 601 const u64 difference_base = align_up_address - cpu_addr_base;
605 if (difference > new_size) { 602 if (difference_base > new_size) {
606 return; 603 return;
607 } 604 }
608 const u64 fixed_size = new_size - difference; 605 const u64 fixed_size = new_size - difference_base;
609 buffer.UnmarkRegionAsGpuModified(align_up_address, fixed_size & align_mask); 606 buffer.UnmarkRegionAsGpuModified(align_up_address, fixed_size & align_mask);
610 }); 607 });
611 }); 608 });
@@ -1384,16 +1381,9 @@ typename BufferCache<P>::Binding BufferCache<P>::StorageBufferBinding(GPUVAddr s
1384 if (!cpu_addr || size == 0) { 1381 if (!cpu_addr || size == 0) {
1385 return NULL_BINDING; 1382 return NULL_BINDING;
1386 } 1383 }
1387 // HACK(Rodrigo): This is the number of bytes bound in host beyond the guest API's range.
1388 // It exists due to some games like Astral Chain operate out of bounds.
1389 // Binding the whole map range would be technically correct, but games have large maps that make
1390 // this approach unaffordable for now.
1391 static constexpr u32 arbitrary_extra_bytes = 0xc000;
1392 const u32 bytes_to_map_end =
1393 std::max(size, static_cast<u32>(gpu_memory.BytesToMapEnd(gpu_addr)));
1394 const Binding binding{ 1384 const Binding binding{
1395 .cpu_addr = *cpu_addr, 1385 .cpu_addr = *cpu_addr,
1396 .size = std::min(size + arbitrary_extra_bytes, bytes_to_map_end), 1386 .size = size,
1397 .buffer_id = BufferId{}, 1387 .buffer_id = BufferId{},
1398 }; 1388 };
1399 return binding; 1389 return binding;