summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-04-12 23:06:05 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-04-15 17:46:17 +0200
commit6789d88a9c9dd4dd7f62d0a8a6291771499590a6 (patch)
tree27539782686570ef884fff36c50130d405e2055f /src
parentMerge pull request #3636 from ReinUsesLisp/drop-vk-hpp (diff)
downloadyuzu-6789d88a9c9dd4dd7f62d0a8a6291771499590a6.tar
yuzu-6789d88a9c9dd4dd7f62d0a8a6291771499590a6.tar.gz
yuzu-6789d88a9c9dd4dd7f62d0a8a6291771499590a6.tar.bz2
yuzu-6789d88a9c9dd4dd7f62d0a8a6291771499590a6.tar.lz
yuzu-6789d88a9c9dd4dd7f62d0a8a6291771499590a6.tar.xz
yuzu-6789d88a9c9dd4dd7f62d0a8a6291771499590a6.tar.zst
yuzu-6789d88a9c9dd4dd7f62d0a8a6291771499590a6.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);