mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-27 02:07:10 +02:00
Conditionally use safe ReadBlock for GPU-modified uploads
This commit is contained in:
parent
0d736d49d6
commit
fbbbca3c10
1 changed files with 6 additions and 2 deletions
|
|
@ -1687,8 +1687,12 @@ void BufferCache<P>::MappedUploadMemory([[maybe_unused]] Buffer& buffer,
|
||||||
for (BufferCopy& copy : copies) {
|
for (BufferCopy& copy : copies) {
|
||||||
u8* const src_pointer = staging_pointer.data() + copy.src_offset;
|
u8* const src_pointer = staging_pointer.data() + copy.src_offset;
|
||||||
const DAddr device_addr = buffer.CpuAddr() + copy.dst_offset;
|
const DAddr device_addr = buffer.CpuAddr() + copy.dst_offset;
|
||||||
device_memory.ReadBlockUnsafe(device_addr, src_pointer, copy.size);
|
const bool needs_safe = memory_tracker.IsRegionGpuModified(device_addr, copy.size);
|
||||||
|
if (needs_safe) {
|
||||||
|
device_memory.ReadBlock(device_addr, src_pointer, copy.size);
|
||||||
|
} else {
|
||||||
|
device_memory.ReadBlockUnsafe(device_addr, src_pointer, copy.size);
|
||||||
|
}
|
||||||
// Apply the staging offset
|
// Apply the staging offset
|
||||||
copy.src_offset += upload_staging.offset;
|
copy.src_offset += upload_staging.offset;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue