feat(bindless): Split synchronization into another thread in debug tool

I think RenderDoc attaches a fence or something, so the dispatch never returns. And ontop of this it looks like timeline semaphores can be signaled back to a lower value, when shared across processes
This commit is contained in:
PancakeTAS 2026-04-26 01:10:19 +02:00
parent cb4992a5dc
commit e611c5b27d
No known key found for this signature in database
2 changed files with 14 additions and 7 deletions

View file

@ -138,7 +138,7 @@ int benchmark::run(const Options& opts) {
auto success = sync.wait(vk, idx++);
if (!success)
throw ls::error("failed to wait for frame");
throw ls::error("Failed to wait for frame");
total_frames++;
generated_frames++;

View file

@ -24,6 +24,7 @@
#include <iostream>
#include <optional>
#include <string>
#include <thread>
#include <vector>
#include <dlfcn.h>
@ -185,6 +186,7 @@ int debug::run(const Options& opts) {
// Render destination images
const uint32_t total{static_cast<uint32_t>(opts.multiplier) - 1U};
size_t idx{1};
for (size_t j = 0; j < paths.size(); j++) {
uploadDDS(vk, source, paths.at(j).string(), j % 2);
@ -192,19 +194,24 @@ int debug::run(const Options& opts) {
rdoc_api->StartFrameCapture(rdoc_device, nullptr);
}
const size_t idx{(j + 1) * total * 2};
sync.signal(vk, idx - 1);
std::thread signal_thread{[&sync, &vk, &idx, total] {
for (size_t i = 0; i < total; i++) {
sync.signal(vk, idx++);
auto success = sync.wait(vk, idx++);
if (!success)
throw ls::error("Failed to wait for frame");
}
}};
lsfgvk_ctx.dispatch(total);
auto success = sync.wait(vk, idx);
if (!success)
throw ls::error("Failed to wait for frame");
if (rdoc_api) {
lsfgvk_ctx.idle();
rdoc_api->EndFrameCapture(rdoc_device, nullptr);
}
signal_thread.join();
}
// Wait for idle