diff options
| author | 2020-04-15 17:06:55 -0300 | |
|---|---|---|
| committer | 2020-04-15 17:06:55 -0300 | |
| commit | 65cbb122ead45a8683c6edd47a83aa8762a4e05b (patch) | |
| tree | 6442abd171353be4d57c4f46a060305b037855f7 /src/video_core/texture_cache | |
| parent | Merge pull request #3612 from ReinUsesLisp/red (diff) | |
| parent | Texture Cache: Read current data when flushing a 3D segment. (diff) | |
| download | yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar.gz yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.tar.xz yuzu-65cbb122ead45a8683c6edd47a83aa8762a4e05b.zip | |
Merge pull request #3649 from FernandoS27/3d-fix
Texture Cache: Read current data when flushing a 3D segment.
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/surface_base.cpp | 6 |
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, | |||
| 248 | 248 | ||
| 249 | // Use an extra temporal buffer | 249 | // Use an extra temporal buffer |
| 250 | auto& tmp_buffer = staging_cache.GetBuffer(1); | 250 | auto& tmp_buffer = staging_cache.GetBuffer(1); |
| 251 | // Special case for 3D Texture Segments | ||
| 252 | const bool must_read_current_data = | ||
| 253 | params.block_depth > 0 && params.target == VideoCore::Surface::SurfaceTarget::Texture2D; | ||
| 251 | tmp_buffer.resize(guest_memory_size); | 254 | tmp_buffer.resize(guest_memory_size); |
| 252 | host_ptr = tmp_buffer.data(); | 255 | host_ptr = tmp_buffer.data(); |
| 256 | if (must_read_current_data) { | ||
| 257 | memory_manager.ReadBlockUnsafe(gpu_addr, host_ptr, guest_memory_size); | ||
| 258 | } | ||
| 253 | 259 | ||
| 254 | if (params.is_tiled) { | 260 | if (params.is_tiled) { |
| 255 | ASSERT_MSG(params.block_width == 0, "Block width is defined as {}", params.block_width); | 261 | ASSERT_MSG(params.block_width == 0, "Block width is defined as {}", params.block_width); |