mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-20 00:29:57 -04:00
In-game mods (GameBanana browser, search and installs, with the Mask Salesman), code-patch and cheat mods, the devs' test18 to test45 work (full performance overlay, frame pacing on, steady frame rate, save export and import, bug capture, new options rows, Setup's Mods page and Add to Steam), occlusion queries and new defaults, Auto resolution that scales, replay helper threads and robust buffers off by default, the options in sections.
25 lines
1.3 KiB
C++
25 lines
1.3 KiB
C++
// Background work of the back end (vk_jobs.cpp): shader translation and pipeline builds run on a few worker threads
|
|
// at below-normal priority while the replay goes on, after totk-pc-recomp's vk_pipeline.c background builds. A draw
|
|
// whose program or pipeline is not ready yet is left out of its frame, or waits for it (vk_draw.cpp decides).
|
|
#pragma once
|
|
|
|
#include <atomic>
|
|
#include <functional>
|
|
|
|
namespace mkwvk {
|
|
|
|
/// Queues fn for a worker (urgent: ahead of the others, for work a draw waits on)
|
|
/// flag: what the job sets when it is done. A jobs_wait on it while the job is still queued runs the job there and then
|
|
void jobs_push(std::function<void()> fn, bool urgent = false, const std::atomic<bool>* flag = nullptr);
|
|
/// Queues fn for the one thread that runs such jobs one at a time, in order
|
|
void jobs_push_serial(std::function<void()> fn);
|
|
/// Waits until flag is set by a job (which calls jobs_notify after setting it)
|
|
void jobs_wait(const std::atomic<bool>& flag);
|
|
/// (Triforce) Waits at most ms for flag (vk_draw.cpp, pipe_wait.h: a wait from a frame's budget). Its job, still queued, goes
|
|
/// to the front for the next worker, and is not run on the waiting thread: a compile could outlast any bound. True: it is set
|
|
bool jobs_wait_for(const std::atomic<bool>& flag, int ms);
|
|
void jobs_notify();
|
|
int jobs_pending();
|
|
|
|
} // namespace mkwvk
|