diff --git a/app/src/main/cpp/skyline/gpu/texture/texture.cpp b/app/src/main/cpp/skyline/gpu/texture/texture.cpp index 6e50ac13..32a6af9a 100644 --- a/app/src/main/cpp/skyline/gpu/texture/texture.cpp +++ b/app/src/main/cpp/skyline/gpu/texture/texture.cpp @@ -825,15 +825,16 @@ namespace skyline::gpu { WaitOnBacking(); if (tiling == vk::ImageTiling::eOptimal || !std::holds_alternative(backing)) { - auto stagingBuffer{gpu.memory.AllocateStagingBuffer(surfaceSize)}; + if (!downloadStagingBuffer) + downloadStagingBuffer = gpu.memory.AllocateStagingBuffer(surfaceSize); WaitOnFence(); auto lCycle{gpu.scheduler.Submit([&](vk::raii::CommandBuffer &commandBuffer) { - CopyIntoStagingBuffer(commandBuffer, stagingBuffer); + CopyIntoStagingBuffer(commandBuffer, downloadStagingBuffer); })}; lCycle->Wait(); // We block till the copy is complete - CopyToGuest(stagingBuffer->data()); + CopyToGuest(downloadStagingBuffer->data()); } else if (tiling == vk::ImageTiling::eLinear) { // We can optimize linear texture sync on a UMA by mapping the texture onto the CPU and copying directly from it rather than using a staging buffer WaitOnFence(); diff --git a/app/src/main/cpp/skyline/gpu/texture/texture.h b/app/src/main/cpp/skyline/gpu/texture/texture.h index 0c0cb6ff..641a1112 100644 --- a/app/src/main/cpp/skyline/gpu/texture/texture.h +++ b/app/src/main/cpp/skyline/gpu/texture/texture.h @@ -406,6 +406,8 @@ namespace skyline::gpu { std::vector views; + std::shared_ptr downloadStagingBuffer{}; + u32 lastRenderPassIndex{}; //!< The index of the last render pass that used this texture texture::RenderPassUsage lastRenderPassUsage{texture::RenderPassUsage::None}; //!< The type of usage in the last render pass