mirror of
https://github.com/daniel-lynch/ovrplugin-openxr-shim.git
synced 2026-10-06 05:00:07 +02:00
fix: deep-review round — legacy-ABI export, threading, and Vulkan robustness
- ovrp_GetTimeInSeconds: real export returning double (legacy direct-return ABI); the autogen ovrpResult stub left d0 uninitialized and the game reads it - seqlock writer: fence the odd-mark before the data stores (torn-pose window) - drain the frameState ring on STOPPING/shutdown (stale displayTime + permanent one-frame skew after every session pause) - begin_frame FIFO bail: bound the wait (surface-teardown deadlock) and measure the deadline on CLOCK_MONOTONIC, immune to wall-clock steps - passthru: pthread_once takeover + acquire/release PT_FWD pointer cache (first-use race could run the shim path mid-takeover) - luma/dump/barcode readback disabled for non-4-byte swapchain formats (staging buffers assumed 4 B/texel; wider fallback formats would overflow) - vkWaitForFences: honor timeouts everywhere; never reset a pending cmd buffer - detect_ue_queue: keep the caller's queue family/index when detection fails - xrr_get_node_pose: g_spaceLock vs the sitting/standing appSpace recreate (locate on a freed XrSpace) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b0503eedb6
commit
574f41a0e4
9 files changed
+160
-30
No files matched your search
+13
-3
@@ -18,12 +18,22 @@ void pt_log_call(const char *name, long ret); /* rate-limited native call cens
|
||||
* resolved pointer per call site. Drop as the FIRST statement of each game-called export
|
||||
* in core.c / layers.c. Compiles to nothing reachable when passthru is off. Logs the
|
||||
* native return value (rate-limited) so we can diff the full call surface vs our shim. */
|
||||
/* The per-site cache is written by whichever thread gets here first while another may
|
||||
* be mid-call on the same export: publish the pointer BEFORE the got-flag (release) and
|
||||
* read the flag with acquire, or a second thread could see got=1 with a still-NULL
|
||||
* pointer and fall through to the shim path for one call — the partial-forwarding
|
||||
* mixed state that crashes mid-frame. Both threads resolving is fine (same value). */
|
||||
#define PT_FWD(fn, ...) do { \
|
||||
if (pt_active()) { \
|
||||
static __typeof__(&fn) _pt_p; static int _pt_got; \
|
||||
if (!_pt_got) { _pt_p = (__typeof__(&fn))pt_real(#fn); _pt_got = 1; } \
|
||||
if (_pt_p) { \
|
||||
__typeof__(_pt_p(__VA_ARGS__)) _pt_r = _pt_p(__VA_ARGS__); \
|
||||
if (!__atomic_load_n(&_pt_got, __ATOMIC_ACQUIRE)) { \
|
||||
__atomic_store_n(&_pt_p, (__typeof__(&fn))pt_real(#fn), \
|
||||
__ATOMIC_RELAXED); \
|
||||
__atomic_store_n(&_pt_got, 1, __ATOMIC_RELEASE); \
|
||||
} \
|
||||
__typeof__(&fn) _pt_f = _pt_p; \
|
||||
if (_pt_f) { \
|
||||
__typeof__(_pt_f(__VA_ARGS__)) _pt_r = _pt_f(__VA_ARGS__); \
|
||||
pt_log_call(#fn, (long)_pt_r); \
|
||||
return _pt_r; \
|
||||
} \
|
||||
|
||||
Reference in new issue
Block a user