mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-05 15:56:49 +00:00
vk: Fix cyclic read-write in dma_block::load/flush
Some DMA block entries are stubs whose parents are DMA_block_EXT entries. Performing load() in this case becomes a memcpy(address, same_address_again, length) which wastes performance and introduces bugs.
This commit is contained in:
parent
8be2a55ccc
commit
b7c2bfbcde
@ -95,6 +95,13 @@ namespace vk
|
||||
|
||||
void dma_block::flush(const utils::address_range& range)
|
||||
{
|
||||
if (inheritance_info.parent)
|
||||
{
|
||||
// Parent may be a different type of block
|
||||
inheritance_info.parent->flush(range);
|
||||
return;
|
||||
}
|
||||
|
||||
auto src = map_range(range);
|
||||
auto dst = vm::get_super_ptr(range.start);
|
||||
std::memcpy(dst, src, range.length());
|
||||
@ -105,6 +112,13 @@ namespace vk
|
||||
|
||||
void dma_block::load(const utils::address_range& range)
|
||||
{
|
||||
if (inheritance_info.parent)
|
||||
{
|
||||
// Parent may be a different type of block
|
||||
inheritance_info.parent->load(range);
|
||||
return;
|
||||
}
|
||||
|
||||
auto src = vm::get_super_ptr(range.start);
|
||||
auto dst = map_range(range);
|
||||
std::memcpy(dst, src, range.length());
|
||||
|
Loading…
Reference in New Issue
Block a user