Add OBS program texture ring option

This commit is contained in:
Meta Vens 2026-05-28 00:04:52 +01:00
commit 9b559a0ebf
10 changed files with 145 additions and 52 deletions

View file

@ -24,6 +24,7 @@ Set these before launching the Mimir app:
$env:FENSALIR_PROGRAM_OUTPUT_D3D12 = "1"
$env:FENSALIR_PROGRAM_OUTPUT_NAME = "Global\MimirFensalirProgramTexture"
$env:FENSALIR_PROGRAM_OUTPUT_FENCE_NAME = "Global\MimirFensalirProgramFence"
$env:FENSALIR_PROGRAM_OUTPUT_RING_COUNT = "1"
dotnet run --project .\src\Mimir.App\Mimir.App.csproj
```
@ -36,6 +37,10 @@ treats JPEG frames as the old VoidBot dashboard fallback only; Mimir dashboard
streaming is `h264-annexb` and displays through a native
`AVSampleBufferDisplayLayer` so the iPad owns hardware decode/composite.
The EVE relay currently consumes the single-texture contract. Keep
`FENSALIR_PROGRAM_OUTPUT_RING_COUNT=1` for EVE until the relay has the same
slot-selection contract as the OBS program texture source.
`scripts/start-eve-dashboard-stream.ps1` starts the Mimir/Fensalir app with the
shared-texture output enabled, starts the H.264 relay, verifies the `eve` SSH
target, opens a reverse SSH tunnel from Eve's `127.0.0.1:8792` back to the

View file

@ -167,8 +167,11 @@ a named invariant that the native runtime cannot protect yet.
OBS source opens it before copying so the consumer is not reading blindly.
This avoids CPU readback and removes Spout2 as a required program-video
dependency, while preserving the explicit boundary cost that libobs is D3D11
on Windows. A later publication ring is still required to make
producer/consumer overwrite races structurally impossible.
on Windows. Fensalir and the OBS source can optionally agree on a bounded
publication ring using `FENSALIR_PROGRAM_OUTPUT_RING_COUNT`; OBS selects the
latest completed slot from the producer fence value. A later consumer
acknowledgement fence is still required to make producer/consumer overwrite
races structurally impossible.
`scripts/build-obs-stem-plugin.ps1` stages the upstream OBS plugin template
SDK under `artifacts/obs-sdk/` and builds the plugin DLL locally.
- `MimirRuntime` no longer submits the legacy direct `AquariumSplineFrame`

View file

@ -30,6 +30,7 @@ Texture` video source. Set:
```text
Shared D3D12 texture name: Global\MimirFensalirProgramTexture
Shared D3D12 fence name: Global\MimirFensalirProgramFence
Texture ring slots: 1
```
OBS/libobs is D3D11 internally on Windows, so this source opens the named D3D12
@ -40,9 +41,22 @@ Spout2. It is not pure zero-copy yet; the remaining copy is the
D3D12-to-libobs-D3D11 boundary. Fensalir also publishes a named D3D12 fence;
the OBS source opens it and observes the producer completion value before
copying. This prevents blind read-before-producer-completion behavior. A later
multi-texture publication ring is still the clean way to make overwrite races
consumer acknowledgement fence is still required to make overwrite races
structurally impossible when producer and consumer cadence diverge.
For OBS-only stress testing, Fensalir and the OBS source can agree on a bounded
texture ring:
```text
FENSALIR_PROGRAM_OUTPUT_RING_COUNT=3
Texture ring slots: 3
```
With a ring count above one, Fensalir publishes textures named
`Global\MimirFensalirProgramTexture.0`, `.1`, and so on. The OBS source uses the
producer fence value to copy the latest completed slot. Leave the ring count at
`1` for EVE until the EVE relay speaks the same ring contract.
For a visible interop witness while the real Mimir scene is sparse, launch
Mimir with: