Skip to content

PIE viewport: cross-platform validation (native Linux + Windows D3D11) #110

@apotema

Description

@apotema

Context

Parent: #59.

Scope

PoC validated:

  • macOS native: 211 MB/s, p50=5µs raw IPC, 0 drops.
  • aarch64 Ubuntu in Docker: 205 MB/s, p50=7.2ms editor-perceived, ~3% drops (container scheduler noise).

This ticket: validate on native Linux + add Windows support.

Linux native

  • Run the integrated editor (post-PIE viewport: editor SHM consumer …) on an x86_64 Linux desktop with real GLFW + Mesa.
  • Measure throughput / latency / drops; expect numbers comparable to macOS once container jitter is gone.
  • If shm.zig needs a Linux-only branch (it didn't in Docker — fingers crossed), document why.

Windows

The PoC has no Windows code today. Two paths:

  1. SHM equivalent via CreateFileMappingW — ~200 LOC of shim. Equivalent perf to the POSIX path. Ships first.
  2. D3D11 shared NT handle + WGL_NV_DX_interop2 — the actual Phase 2 fast path on Windows. Producer creates a D3D11 texture with D3D11_RESOURCE_MISC_SHARED_NTHANDLE | _KEYEDMUTEX, sends handle via DuplicateHandle over named pipe. Consumer registers via wglDXOpenDeviceNV + wglDXRegisterObjectNV and gets a GL texture for free. Spout2 (open source) is essentially this code; references in the PoC research notes.

Ship 1 first; 2 is its own ticket if/when needed.

Test plan

  • Native Linux run of imgui-preview-poc (or post-integration editor) reaches its own bench-equivalent numbers.
  • Windows SHM path builds + runs the PoC on a Windows 11 machine.
  • CI: add a Windows job to imgui-preview-poc (or the eventual integrated build) that at least builds the editor + game.

Non-goals

  • Wayland — X11 first, Wayland separate.
  • WSL2 — same as native Linux from the editor's perspective, no extra work.

References

  • Linux Docker results: imgui-preview-poc/experiments/bench/LINUX_RESULTS.md
  • D3D11 interop research: imgui-preview-poc/README.md → research summary section

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions