diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-12-22 22:52:53 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-12-25 21:38:36 +0100 |
commit | c448b3af2ffe06f036e06b610c87db8dab74b766 (patch) | |
tree | 939a3097ca991ebb651e116596e30382b64030cf /src/video_core/texture_cache/util.cpp | |
parent | Merge pull request #9500 from liamwhite/reentrant-shutdown (diff) | |
download | yuzu-c448b3af2ffe06f036e06b610c87db8dab74b766.tar yuzu-c448b3af2ffe06f036e06b610c87db8dab74b766.tar.gz yuzu-c448b3af2ffe06f036e06b610c87db8dab74b766.tar.bz2 yuzu-c448b3af2ffe06f036e06b610c87db8dab74b766.tar.lz yuzu-c448b3af2ffe06f036e06b610c87db8dab74b766.tar.xz yuzu-c448b3af2ffe06f036e06b610c87db8dab74b766.tar.zst yuzu-c448b3af2ffe06f036e06b610c87db8dab74b766.zip |
Diffstat (limited to 'src/video_core/texture_cache/util.cpp')
-rw-r--r-- | src/video_core/texture_cache/util.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index e8c908b42..4488fa9da 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -765,8 +765,9 @@ bool IsValidEntry(const Tegra::MemoryManager& gpu_memory, const TICEntry& config } std::vector<BufferImageCopy> UnswizzleImage(Tegra::MemoryManager& gpu_memory, GPUVAddr gpu_addr, - const ImageInfo& info, std::span<u8> output) { - const size_t guest_size_bytes = CalculateGuestSizeInBytes(info); + const ImageInfo& info, std::span<const u8> input, + std::span<u8> output) { + const size_t guest_size_bytes = input.size_bytes(); const u32 bpp_log2 = BytesPerBlockLog2(info.format); const Extent3D size = info.size; @@ -789,10 +790,6 @@ std::vector<BufferImageCopy> UnswizzleImage(Tegra::MemoryManager& gpu_memory, GP .image_extent = size, }}; } - const auto input_data = std::make_unique<u8[]>(guest_size_bytes); - gpu_memory.ReadBlockUnsafe(gpu_addr, input_data.get(), guest_size_bytes); - const std::span<const u8> input(input_data.get(), guest_size_bytes); - const LevelInfo level_info = MakeLevelInfo(info); const s32 num_layers = info.resources.layers; const s32 num_levels = info.resources.levels; |