Repository navigation
PR 0002 release owned SDL context and hidden window
- GitHub state: Merged
- Disposition at review: Merged
-
Current head at review:
b1216d29ba63091b5db68d18451b488ce4861956(fix/eng-2026-523-gloffscreen-owned-resources-u39e70992) -
Reviewed head:
b1216d29ba63091b5db68d18451b488ce4861956 - Last reviewed: 2026-09-14 UTC
-
Base:
mainatab2f8a8be80725a2c0c7a03050c1c5ee2e45fd35 - Subsystem: OpenGL / SDL context ownership
Review freshness: this page records the final/known PR head at review time. If the PR is reopened or rewritten, re-review before relying on implementation details.
- What it changes: release owned SDL context and hidden window
- Why it was attempted: Observed problem: The temporary GPU-properties probe created an SDL GL context and hidden SDL window, but glo context destroy() detached the context and freed only the wrapper. Profiling evidence: This is a lifecycle/resource correctness defect. The old byte-equivalent path leaked on the first cycle; the repaired lifecycle repeatedly returns to the starting window count. Suspected cause: Wrapper-owned SDL resources were never explicitly destroyed. Why thi…
- Current/final result: Merged focused ownership cleanup with unit coverage for context/window release.
- Lesson: The offscreen SDL GL context and hidden window are owned resources and must be released in the correct teardown path; lifecycle leaks are correctness/resource bugs even without a performance campaign.
| Implementation file | Δ | Why it matters |
|---|---|---|
hw/xbox/nv2a/pgraph/thirdparty/gloffscreen/sdl.c |
+2/-0 | Owned SDL GL context/hidden-window creation and teardown. |
tests/unit/meson.build |
+11/-0 | Focused/regression validation for the implementation contract. |
tests/unit/test-xbox-gloffscreen.c |
+81/-0 | Focused/regression validation for the implementation contract. |
flowchart LR
subgraph Before
A[OpenGL / SDL context ownership input] --> B[Existing path] --> C[Observed limitation/cost] --> D[Guest-visible result]
end
subgraph PR_2[PR #2]
E[OpenGL / SDL context ownership input] --> F[PR #2 change/measurement] --> G[Qualified behavior] --> H[Guest-visible result]
end
Add SDL GL DestroyContext(ctx- context) . - Add SDL DestroyWindow(ctx- window) . - Add opt-in shared-context lifecycle coverage with null destruction, repeated cycles, texture sharing, and window-count validation. - Register the interactive test while keeping runtime execution gated by XEMU TEST GLOFFSCREEN=1 . Main code path: hw/xbox/nv2a/pgraph/thirdparty/gloffscreen/sdl.c , tests/unit/test-xbox-gloffscreen.c , tests/unit/meson.build Commits: exact current-main candidate b1216d29ba63091b5db68d18451b488ce4861956
Merged focused ownership cleanup with unit coverage for context/window release.
The offscreen SDL GL context and hidden window are owned resources and must be released in the correct teardown path; lifecycle leaks are correctness/resource bugs even without a performance campaign.
Do not destroy surrounding renderer state while leaving the owned SDL context/window alive, and do not require a broad performance campaign for an isolated ownership fix unless behavior changes.
No dedicated docs/evidence path was identified from the PR file list or PR body. Use the linked PR discussion and commit history as the primary record.
DSP tooling guide and navigation updated November 2, 2026 for experimental PR #384, source 8f51d237. Capture/replay usage and limits.
The earlier wiki-wide review was published November 1, 2026. Emulator source: b7140848. Reviewed wiki content: 1d2b671. Current status · Release availability · Publication process.
- Home
- Current status
- Stable versus main
- Implemented mechanisms
- Controls and defaults
- Measured results and limits
- Complete change register
- System
- CPU and vCPU
- Memory and DMA
- Graphics / NV2A
- APU and audio
- Timing and timers
- Platform and I/O
- Hardware observations
- Fidelity boundaries
- Methodology
- PGR2 routes
- Debugging lag / hot paths
- Tools and commands
- DSP capture, replay and fuzzing
- HLE readiness and public XISO proof
- Concurrent DSP shadow and OpenAL proof
- DSP HLE operation inventory
- DSP HLE fix examples and testing
- Development
- Upstream shortlist
- Wiki maintenance
- Research / retired work
- Optimization catalog
- Hot-path shortcuts
- Researched experiments
- Unproven proposal directory
- PR lessons
- September26 snapshot
Repository · PRs · Issues