From d174ca950b376936a1ba1514036b9651e805da78 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Wed, 21 Sep 2022 21:02:45 +0100 Subject: [PATCH] Revert "Reset executor command buffers asynchronously" This reverts commit fc7956df4ff56fdb2afc4b2bb0bbca82196179ca. --- .../gpu/interconnect/command_executor.cpp | 22 +------------------ .../gpu/interconnect/command_executor.h | 13 ----------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp index e6c1e47d..e8214fa6 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp @@ -29,27 +29,10 @@ namespace skyline::gpu::interconnect { fence{gpu.vkDevice, vk::FenceCreateInfo{ .flags = vk::FenceCreateFlagBits::eSignaled }}, cycle{std::make_shared(gpu.vkDevice, *fence, true)} {} - CommandRecordThread::Slot::ScopedReset::ScopedReset(CommandRecordThread::Slot &slot) : slot{slot} {} - - CommandRecordThread::Slot::ScopedReset::~ScopedReset() { - std::scoped_lock resetLock{slot.resetMutex}; - if (slot.needsReset) - slot.commandBuffer.reset(); - - slot.needsReset = false; - } - std::shared_ptr CommandRecordThread::Slot::Reset(GPU &gpu) { cycle->Wait(); cycle = std::make_shared(gpu.vkDevice, *fence); - - std::scoped_lock resetLock{resetMutex}; - if (needsReset) - commandBuffer.reset(); - - needsReset = false; - cycle->AttachObjects(std::make_shared(*this)); - + commandBuffer.reset(); return cycle; } @@ -89,9 +72,6 @@ namespace skyline::gpu::interconnect { slot->nodes.clear(); slot->allocator.Reset(); - - std::scoped_lock resetLock{slot->resetMutex}; - slot->needsReset = true; } void CommandRecordThread::Run() { diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h index b2a6b148..e8bf0ee8 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h @@ -19,25 +19,12 @@ namespace skyline::gpu::interconnect { * @brief Single execution slot, buffered back and forth between the GPFIFO thread and the record thread */ struct Slot { - /** - * @brief Helper to reset a slot's command buffer asynchronously - */ - struct ScopedReset { - Slot &slot; - - ScopedReset(Slot &slot); - - ~ScopedReset(); - }; - vk::raii::CommandPool commandPool; //!< Use one command pool per slot since command buffers from different slots may be recorded into on multiple threads at the same time vk::raii::CommandBuffer commandBuffer; vk::raii::Fence fence; std::shared_ptr cycle; boost::container::stable_vector nodes; LinearAllocatorState<> allocator; - std::mutex resetMutex; - bool needsReset{}; //!< If the slot's command buffer needs to be reset before it can be used again Slot(GPU &gpu);