mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 10:47:34 +01:00
Merge pull request #3649 from FernandoS27/3d-fix
Texture Cache: Read current data when flushing a 3D segment.
This commit is contained in:
commit
65cbb122ea
@ -248,8 +248,14 @@ void SurfaceBaseImpl::FlushBuffer(Tegra::MemoryManager& memory_manager,
|
|||||||
|
|
||||||
// Use an extra temporal buffer
|
// Use an extra temporal buffer
|
||||||
auto& tmp_buffer = staging_cache.GetBuffer(1);
|
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);
|
tmp_buffer.resize(guest_memory_size);
|
||||||
host_ptr = tmp_buffer.data();
|
host_ptr = tmp_buffer.data();
|
||||||
|
if (must_read_current_data) {
|
||||||
|
memory_manager.ReadBlockUnsafe(gpu_addr, host_ptr, guest_memory_size);
|
||||||
|
}
|
||||||
|
|
||||||
if (params.is_tiled) {
|
if (params.is_tiled) {
|
||||||
ASSERT_MSG(params.block_width == 0, "Block width is defined as {}", params.block_width);
|
ASSERT_MSG(params.block_width == 0, "Block width is defined as {}", params.block_width);
|
||||||
|
Loading…
Reference in New Issue
Block a user