summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRodrigo Locatti <reinuseslisp@airmail.cc>2020-04-15 22:06:55 +0200
committerGitHub <noreply@github.com>2020-04-15 22:06:55 +0200
commit65cbb122ead45a8683c6edd47a83aa8762a4e05b (patch)
tree6442abd171353be4d57c4f46a060305b037855f7 /src
parentMerge pull request #3612 from ReinUsesLisp/red (diff)
parentTexture Cache: Read current data when flushing a 3D segment. (diff)
downloadyuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar
yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar.gz
yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar.bz2
yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar.lz
yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar.xz
yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar.zst
yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/surface_base.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/surface_base.cpp b/src/video_core/texture_cache/surface_base.cpp
index 7af0e792c..715f39d0d 100644
--- a/src/video_core/texture_cache/surface_base.cpp
+++ b/src/video_core/texture_cache/surface_base.cpp
@@ -248,8 +248,14 @@ void SurfaceBaseImpl::FlushBuffer(Tegra::MemoryManager& memory_manager,
// Use an extra temporal buffer
auto& tmp_buffer = staging_cache.GetBuffer(1);
+ // Special case for 3D Texture Segments
+ const bool must_read_current_data =
+ params.block_depth > 0 && params.target == VideoCore::Surface::SurfaceTarget::Texture2D;
tmp_buffer.resize(guest_memory_size);
host_ptr = tmp_buffer.data();
+ if (must_read_current_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 {}", params.block_width);