Observe program output producer fence

This commit is contained in:
Meta Vens 2026-05-27 23:56:42 +01:00
commit 72738e6676
10 changed files with 106 additions and 19 deletions

View file

@ -23,16 +23,18 @@ Set these before launching the Mimir app:
```powershell
$env:FENSALIR_PROGRAM_OUTPUT_D3D12 = "1"
$env:FENSALIR_PROGRAM_OUTPUT_NAME = "Global\MimirFensalirProgramTexture"
$env:FENSALIR_PROGRAM_OUTPUT_FENCE_NAME = "Global\MimirFensalirProgramFence"
dotnet run --project .\src\Mimir.App\Mimir.App.csproj
```
Fensalir creates a shareable D3D12 texture with that name and copies the finished
backbuffer into it during the present pass. `Mimir.EveRelay` opens that named
texture, reads the completed program frame, feeds a low-latency H.264 encoder,
and sends complete Annex-B access units to EveCanvas over the existing
`/stream` WebSocket. EveCanvas 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.
Fensalir creates a shareable D3D12 texture with that name, publishes a named
producer fence, and copies the finished backbuffer into the texture during the
present pass. `Mimir.EveRelay` opens that named texture, reads the completed
program frame, feeds a low-latency H.264 encoder, and sends complete Annex-B
access units to EveCanvas over the existing `/stream` WebSocket. EveCanvas
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.
`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

View file

@ -163,11 +163,14 @@ a named invariant that the native runtime cannot protect yet.
`Mimir Audio Stem`, which reads one named stem and submits it to OBS as an
audio source, and `Mimir Program Texture`, which opens Fensalir's named D3D12
program-output texture and feeds OBS through a GPU-to-GPU D3D12-to-D3D11
bridge texture. 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. `scripts/build-obs-stem-plugin.ps1` stages the
upstream OBS plugin template SDK under `artifacts/obs-sdk/` and builds the
plugin DLL locally.
bridge texture. Fensalir also publishes a named D3D12 producer fence, and the
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.
`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`
spectrum dashboard. Live spectrum visualization authority is the
`AquariumFieldEvidenceFrame`: Mimir declares the rolling resource, emits a

View file

@ -29,6 +29,7 @@ Texture` video source. Set:
```text
Shared D3D12 texture name: Global\MimirFensalirProgramTexture
Shared D3D12 fence name: Global\MimirFensalirProgramFence
```
OBS/libobs is D3D11 internally on Windows, so this source opens the named D3D12
@ -36,7 +37,11 @@ texture, creates an OBS-readable legacy shared D3D11 texture, opens that same
bridge texture from D3D12, and performs a GPU-to-GPU copy during OBS render
before drawing the source. This avoids CPU readback and does not require
Spout2. It is not pure zero-copy yet; the remaining copy is the
D3D12-to-libobs-D3D11 boundary.
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
structurally impossible when producer and consumer cadence diverge.
For a visible interop witness while the real Mimir scene is sparse, launch
Mimir with: