mirror of
https://github.com/daniel-lynch/ovrplugin-openxr-shim.git
synced 2026-10-06 01:00:05 +02:00
An independent reimplementation of Meta's libOVRPlugin ABI on top of OpenXR, so VrApi-era Meta Quest VR titles can run on non-Meta OpenXR runtimes (Monado, Steam Frame) instead of being locked to Meta hardware. Original code only — no Meta/Epic/Capcom binaries, headers, or assets. Includes a desktop harness that drives the shim against Monado headless. Scope/legal: interoperability; entitlement handling is out of scope. See README for the legal/scope section and docs/ for the research trail and design notes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D6sFYGXZPsq3v7xtcDES6g
32 lines
1.5 KiB
C
32 lines
1.5 KiB
C
/* xrexts.c — list the OpenXR instance extensions the active runtime advertises.
|
|
* Recon for the foveation bring-up: tells us which foveation / FDM / eye-tracking
|
|
* extensions THIS runtime (Monado/Lepton) exposes, so we know what to wire into the
|
|
* shim's apply_foveation() extension point. No Vulkan, no session — just enumerate.
|
|
* cc xrexts.c -lopenxr_loader -o xrexts && XR_RUNTIME_JSON=.../openxr_monado.json ./xrexts */
|
|
#define _GNU_SOURCE
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <openxr/openxr.h>
|
|
|
|
int main(void) {
|
|
uint32_t n = 0;
|
|
if (xrEnumerateInstanceExtensionProperties(NULL, 0, &n, NULL) != XR_SUCCESS || !n) {
|
|
fprintf(stderr, "xrEnumerateInstanceExtensionProperties failed (runtime selected? service up?)\n");
|
|
return 1;
|
|
}
|
|
XrExtensionProperties *p = calloc(n, sizeof *p);
|
|
for (uint32_t i = 0; i < n; i++) p[i].type = XR_TYPE_EXTENSION_PROPERTIES;
|
|
if (xrEnumerateInstanceExtensionProperties(NULL, n, &n, p) != XR_SUCCESS) return 1;
|
|
|
|
printf("runtime advertises %u instance extensions:\n", n);
|
|
for (uint32_t i = 0; i < n; i++) {
|
|
const char *e = p[i].extensionName;
|
|
int hot = strcasestr(e, "fov") || strcasestr(e, "foveat") || strcasestr(e, "density")
|
|
|| strcasestr(e, "fdm") || strcasestr(e, "eye") || strcasestr(e, "gaze")
|
|
|| strcasestr(e, "vrs") || strcasestr(e, "shading_rate") || strcasestr(e, "quad");
|
|
printf(" %s %s (v%u)\n", hot ? "**" : " ", e, p[i].extensionVersion);
|
|
}
|
|
return 0;
|
|
}
|