mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-28 06:55:29 +03:00
Implement a way to check if the command record thread is idle
Useful for debugging and testing
This commit is contained in:
parent
c67f27e914
commit
89c6fab1cb
@ -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()};
|
||||
|
@ -68,6 +68,7 @@ namespace skyline::gpu::interconnect {
|
||||
CircularQueue<Slot *> incoming; //!< Slots pending recording
|
||||
CircularQueue<Slot *> outgoing; //!< Slots that have been submitted, may still be active on the GPU
|
||||
std::list<Slot> slots;
|
||||
std::atomic<bool> 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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user