Revert "Reset executor command buffers asynchronously"

This reverts commit fc7956df4ff56fdb2afc4b2bb0bbca82196179ca.
This commit is contained in:
Billy Laws 2022-09-21 21:02:45 +01:00
parent 2bbe975ea7
commit d174ca950b
2 changed files with 1 additions and 34 deletions

View File

@ -29,27 +29,10 @@ namespace skyline::gpu::interconnect {
fence{gpu.vkDevice, vk::FenceCreateInfo{ .flags = vk::FenceCreateFlagBits::eSignaled }},
cycle{std::make_shared<FenceCycle>(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<FenceCycle> CommandRecordThread::Slot::Reset(GPU &gpu) {
cycle->Wait();
cycle = std::make_shared<FenceCycle>(gpu.vkDevice, *fence);
std::scoped_lock resetLock{resetMutex};
if (needsReset)
commandBuffer.reset();
needsReset = false;
cycle->AttachObjects(std::make_shared<ScopedReset>(*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() {

View File

@ -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<FenceCycle> cycle;
boost::container::stable_vector<node::NodeVariant> 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);