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 29ee52d9..8e310b8f 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp @@ -140,6 +140,7 @@ namespace skyline::gpu::interconnect { signal::SetSignalHandler({SIGINT, SIGILL, SIGTRAP, SIGBUS, SIGFPE, SIGSEGV}, signal::ExceptionalSignalHandler); incoming.Process([this, renderDocApi, &gpu](Slot *slot) { + idle = false; VkInstance instance{*gpu.vkInstance}; if (renderDocApi && slot->capture) renderDocApi->StartFrameCapture(RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(instance), nullptr); @@ -157,6 +158,7 @@ namespace skyline::gpu::interconnect { } outgoing.Push(slot); + idle = true; }, [] {}); } catch (const signal::SignalException &e) { Logger::Error("{}\nStack Trace:{}", e.what(), state.loader->GetStackTrace(e.frames)); @@ -173,6 +175,10 @@ namespace skyline::gpu::interconnect { } } + bool CommandRecordThread::IsIdle() const { + return idle; + } + CommandRecordThread::Slot *CommandRecordThread::AcquireSlot() { auto startTime{util::GetTimeNs()}; auto slot{outgoing.Pop()}; 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 d0935f3a..789005bb 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h @@ -68,6 +68,7 @@ namespace skyline::gpu::interconnect { CircularQueue incoming; //!< Slots pending recording CircularQueue outgoing; //!< Slots that have been submitted, may still be active on the GPU std::list slots; + std::atomic idle; std::thread thread; @@ -78,6 +79,8 @@ namespace skyline::gpu::interconnect { public: CommandRecordThread(const DeviceState &state); + bool IsIdle() const; + /** * @return A free slot, `Reset` needs to be called before accessing it */