summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-04-05 12:58:23 -0400
committerGravatar Fernando Sahmkow2020-04-06 09:21:46 -0400
commit9c0f40a1f5bea37b87a31e9f957c4d2a14a8e421 (patch)
tree0aca3e4623f87ee57694b028bea75fdf2ae3c32c /src/core/memory.cpp
parentMerge pull request #3513 from ReinUsesLisp/native-astc (diff)
downloadyuzu-9c0f40a1f5bea37b87a31e9f957c4d2a14a8e421.tar.gz
yuzu-9c0f40a1f5bea37b87a31e9f957c4d2a14a8e421.tar.xz
yuzu-9c0f40a1f5bea37b87a31e9f957c4d2a14a8e421.zip
GPU: Setup Flush/Invalidate to use VAddr instead of CacheAddr
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index f0888327f..9ceb7fabc 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -242,7 +242,7 @@ struct Memory::Impl {
242 } 242 }
243 case Common::PageType::RasterizerCachedMemory: { 243 case Common::PageType::RasterizerCachedMemory: {
244 const u8* const host_ptr = GetPointerFromVMA(process, current_vaddr); 244 const u8* const host_ptr = GetPointerFromVMA(process, current_vaddr);
245 system.GPU().FlushRegion(ToCacheAddr(host_ptr), copy_amount); 245 system.GPU().FlushRegion(current_vaddr, copy_amount);
246 std::memcpy(dest_buffer, host_ptr, copy_amount); 246 std::memcpy(dest_buffer, host_ptr, copy_amount);
247 break; 247 break;
248 } 248 }
@@ -290,7 +290,7 @@ struct Memory::Impl {
290 } 290 }
291 case Common::PageType::RasterizerCachedMemory: { 291 case Common::PageType::RasterizerCachedMemory: {
292 u8* const host_ptr = GetPointerFromVMA(process, current_vaddr); 292 u8* const host_ptr = GetPointerFromVMA(process, current_vaddr);
293 system.GPU().InvalidateRegion(ToCacheAddr(host_ptr), copy_amount); 293 system.GPU().InvalidateRegion(current_vaddr, copy_amount);
294 std::memcpy(host_ptr, src_buffer, copy_amount); 294 std::memcpy(host_ptr, src_buffer, copy_amount);
295 break; 295 break;
296 } 296 }
@@ -337,7 +337,7 @@ struct Memory::Impl {
337 } 337 }
338 case Common::PageType::RasterizerCachedMemory: { 338 case Common::PageType::RasterizerCachedMemory: {
339 u8* const host_ptr = GetPointerFromVMA(process, current_vaddr); 339 u8* const host_ptr = GetPointerFromVMA(process, current_vaddr);
340 system.GPU().InvalidateRegion(ToCacheAddr(host_ptr), copy_amount); 340 system.GPU().InvalidateRegion(current_vaddr, copy_amount);
341 std::memset(host_ptr, 0, copy_amount); 341 std::memset(host_ptr, 0, copy_amount);
342 break; 342 break;
343 } 343 }
@@ -384,7 +384,7 @@ struct Memory::Impl {
384 } 384 }
385 case Common::PageType::RasterizerCachedMemory: { 385 case Common::PageType::RasterizerCachedMemory: {
386 const u8* const host_ptr = GetPointerFromVMA(process, current_vaddr); 386 const u8* const host_ptr = GetPointerFromVMA(process, current_vaddr);
387 system.GPU().FlushRegion(ToCacheAddr(host_ptr), copy_amount); 387 system.GPU().FlushRegion(current_vaddr, copy_amount);
388 WriteBlock(process, dest_addr, host_ptr, copy_amount); 388 WriteBlock(process, dest_addr, host_ptr, copy_amount);
389 break; 389 break;
390 } 390 }
@@ -545,7 +545,7 @@ struct Memory::Impl {
545 break; 545 break;
546 case Common::PageType::RasterizerCachedMemory: { 546 case Common::PageType::RasterizerCachedMemory: {
547 const u8* const host_ptr = GetPointerFromVMA(vaddr); 547 const u8* const host_ptr = GetPointerFromVMA(vaddr);
548 system.GPU().FlushRegion(ToCacheAddr(host_ptr), sizeof(T)); 548 system.GPU().FlushRegion(vaddr, sizeof(T));
549 T value; 549 T value;
550 std::memcpy(&value, host_ptr, sizeof(T)); 550 std::memcpy(&value, host_ptr, sizeof(T));
551 return value; 551 return value;
@@ -587,7 +587,7 @@ struct Memory::Impl {
587 break; 587 break;
588 case Common::PageType::RasterizerCachedMemory: { 588 case Common::PageType::RasterizerCachedMemory: {
589 u8* const host_ptr{GetPointerFromVMA(vaddr)}; 589 u8* const host_ptr{GetPointerFromVMA(vaddr)};
590 system.GPU().InvalidateRegion(ToCacheAddr(host_ptr), sizeof(T)); 590 system.GPU().InvalidateRegion(vaddr, sizeof(T));
591 std::memcpy(host_ptr, &data, sizeof(T)); 591 std::memcpy(host_ptr, &data, sizeof(T));
592 break; 592 break;
593 } 593 }