summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache/surface_base.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-04-05 21:26:16 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-04-06 15:23:05 +0200
commit6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb (patch)
tree5486a9f2240c49d4125930723ffa8286fd127164 /src/video_core/texture_cache/surface_base.cpp
parentGPU: Setup Flush/Invalidate to use VAddr instead of CacheAddr (diff)
downloadyuzu-6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb.tar
yuzu-6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb.tar.gz
yuzu-6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb.tar.bz2
yuzu-6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb.tar.lz
yuzu-6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb.tar.xz
yuzu-6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb.tar.zst
yuzu-6ee316cb8f4d6f28b4dcad7a8a3d447fdf70d3bb.zip
Diffstat (limited to 'src/video_core/texture_cache/surface_base.cpp')
-rw-r--r--src/video_core/texture_cache/surface_base.cpp42
1 files changed, 10 insertions, 32 deletions
diff --git a/src/video_core/texture_cache/surface_base.cpp b/src/video_core/texture_cache/surface_base.cpp
index 6fe815135..7af0e792c 100644
--- a/src/video_core/texture_cache/surface_base.cpp
+++ b/src/video_core/texture_cache/surface_base.cpp
@@ -190,22 +190,11 @@ void SurfaceBaseImpl::LoadBuffer(Tegra::MemoryManager& memory_manager,
MICROPROFILE_SCOPE(GPU_Load_Texture);
auto& staging_buffer = staging_cache.GetBuffer(0);
u8* host_ptr;
- is_continuous = memory_manager.IsBlockContinuous(gpu_addr, guest_memory_size);
-
- // Handle continuouty
- if (is_continuous) {
- // Use physical memory directly
- host_ptr = memory_manager.GetPointer(gpu_addr);
- if (!host_ptr) {
- return;
- }
- } else {
- // Use an extra temporal buffer
- auto& tmp_buffer = staging_cache.GetBuffer(1);
- tmp_buffer.resize(guest_memory_size);
- host_ptr = tmp_buffer.data();
- memory_manager.ReadBlockUnsafe(gpu_addr, host_ptr, guest_memory_size);
- }
+ // Use an extra temporal buffer
+ auto& tmp_buffer = staging_cache.GetBuffer(1);
+ tmp_buffer.resize(guest_memory_size);
+ host_ptr = tmp_buffer.data();
+ memory_manager.ReadBlockUnsafe(gpu_addr, host_ptr, guest_memory_size);
if (params.is_tiled) {
ASSERT_MSG(params.block_width == 0, "Block width is defined as {} on texture target {}",
@@ -257,19 +246,10 @@ void SurfaceBaseImpl::FlushBuffer(Tegra::MemoryManager& memory_manager,
auto& staging_buffer = staging_cache.GetBuffer(0);
u8* host_ptr;
- // Handle continuouty
- if (is_continuous) {
- // Use physical memory directly
- host_ptr = memory_manager.GetPointer(gpu_addr);
- if (!host_ptr) {
- return;
- }
- } else {
- // Use an extra temporal buffer
- auto& tmp_buffer = staging_cache.GetBuffer(1);
- tmp_buffer.resize(guest_memory_size);
- host_ptr = tmp_buffer.data();
- }
+ // Use an extra temporal buffer
+ auto& tmp_buffer = staging_cache.GetBuffer(1);
+ tmp_buffer.resize(guest_memory_size);
+ host_ptr = tmp_buffer.data();
if (params.is_tiled) {
ASSERT_MSG(params.block_width == 0, "Block width is defined as {}", params.block_width);
@@ -300,9 +280,7 @@ void SurfaceBaseImpl::FlushBuffer(Tegra::MemoryManager& memory_manager,
}
}
}
- if (!is_continuous) {
- memory_manager.WriteBlockUnsafe(gpu_addr, host_ptr, guest_memory_size);
- }
+ memory_manager.WriteBlockUnsafe(gpu_addr, host_ptr, guest_memory_size);
}
} // namespace VideoCommon