Give the Vulkan allocator one owning thread

Readback buffers are allocated when the readback is recorded rather than on the render thread,
so only the thread that records frames touches VMA. The allocator is created externally
synchronized, and VMA is built with no-op mutexes and plain counters instead of std::mutex and
std::atomic.

Headless runs Vulkan offscreen in builds without SDL too, and CI runs the headless tests on
lavapipe, skipping the pixel tests a hardware backend doesn't match the software references on.
sleep_ms and sleep_us go, with the thread manager test waiting on an event instead, and so does
the unused portable-file-dialogs header.
This commit is contained in:
libretroadmin committed 2026-10-09 07:37:57 +02:00
1 parent f1208a7a5a
commit b570567b88
18 files changed
+173 -2003

No files matched your search

+12 -6
View File
@@ -4,6 +4,7 @@
#include "Common/Log.h"
#include "Common/TimeUtil.h"
#include "Common/Thread/Barrier.h"
#include "Common/Thread/Event.h"
#include "Common/Thread/ThreadManager.h"
#include "Common/Thread/Channel.h"
#include "Common/Thread/Promise.h"
@@ -18,8 +19,11 @@ struct ResultObject {
bool ok;
};
// Holds the result back until the parallel loop test is done, so BlockUntilReady really waits.
static Event *g_resultGate;
ResultObject *ResultProducer() {
sleep_ms(250, "test-result");
g_resultGate->Wait();
printf("result produced: thread %d\n", GetCurrentThreadIdForDebug());
return new ResultObject{ true };
}
@@ -36,7 +40,6 @@ bool TestMailbox() {
}
void rangeFunc(int lower, int upper) {
sleep_ms(30, "test-range");
printf(" - range %d-%d (thread %d)\n", lower, upper, GetCurrentThreadIdForDebug());
}
@@ -130,12 +133,12 @@ bool TestThreadManager() {
g_threadMan = &manager;
Event resultGate;
g_resultGate = &resultGate;
Promise<ResultObject *> *object(Promise<ResultObject *>::Spawn(&manager, &ResultProducer, TaskType::IO_BLOCKING));
if (!TestParallelLoop(&manager)) {
return false;
}
sleep_ms(100, "test-threadman");
const bool loopOk = TestParallelLoop(&manager);
resultGate.Notify();
ResultObject *result = object->BlockUntilReady();
if (result) {
@@ -143,6 +146,9 @@ bool TestThreadManager() {
}
delete object;
if (!loopOk) {
return false;
}
if (!TestMailbox()) {
return false;