diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-04-09 22:59:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 22:59:21 +0200 |
commit | 36f607217fa9172d2e1b76e327fdb03b0498ae4d (patch) | |
tree | 523309af11b2e7f47f3f6060fad1d86e9d446206 /src/video_core/texture_cache/surface_base.cpp | |
parent | Merge pull request #3601 from ReinUsesLisp/some-shader-encodings (diff) | |
parent | VkRasterizer: Eliminate Legacy code. (diff) | |
download | yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.gz yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.bz2 yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.lz yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.xz yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.zst yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.zip |
Diffstat (limited to 'src/video_core/texture_cache/surface_base.cpp')
-rw-r--r-- | src/video_core/texture_cache/surface_base.cpp | 42 |
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 |