Fix black screen on multi-plane presents #3375
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3375
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3373"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KelboLive on GitHub · 2026-11-28 15:43 UTC · original
KelboLive:fix/black-screen-plane-composite-v2→main· +3 −1 · 1 files · 1 commits · closed without mergingWhen a game presents multiple planes (e.g., plane 0 for UI, plane 1 for the main picture), the window presenter previously only showed plane 0 by default. If plane 0 was empty or black in some titles, the output window would appear completely black even though audio and other rendering were working correctly.
This change updates
presented_planes()to automatically composite all planes when more than one is present (unless explicitly overridden viaX2W_PRESENT_PLANE), ensuring the main picture is visible.Changes
src/startup_stubs/d3d12_xs_device.cpp: Updated the logic inpresented_planes()to include all planes for compositing whenplanes > 1, rather than defaulting to just plane 0.Testing
@KelboLive on GitHub · 2026-11-28 21:59 UTC · original · reviewed
LGTM — ready for approval from another maintainer once reviewed.
No outstanding issues identified. Safe to merge.
@Leyukaka on GitHub · 2026-11-29 06:34 UTC · original · requested changes
Changes requested at
462c3d84(by reading the code; nothing was built or run).With
X2W_PRESENT_COMPOSITEunset, the window compositor is still created for one plane:present_to_window(..., presented.drawable, present_composite_enabled() ? window_planes : 1)(d3d12_xs_device.cpp:7578). That capacity goes toPlaneCompositor::createon the first present only (d3d12_present.inl:169, :139).recordstops atmax_planes_drawn planes (plane_compositor.h:120-121), and the blend pipeline is built only whenmax_planes_ > 1(:54). So the newplanes > 1branch selects every plane, but only the lowest drawable one is drawn:Also:
presented_planes()is in the anonymous namespace of d3d12_xs_device.cpp and no file under tests/ references it, so the changed line is not tested.startup_present_planesandstartup_present_composite_*are not in theprtest preset filter, so the green checks do not cover it either.#3378 changes the same selection line, passes
window_planesas the capacity, and updates the docs andstartup_present_planes. It covers what this PR intends, so fixing the capacity here would duplicate it; the two conflict inpresented_planes(), so one of them has to close (my notes on #3378 are on that PR).@JohnConnorNPC on GitHub · 2026-11-29 12:53 UTC · original
Reviewed at
462c3d8425against main77d1ba4d(by reading the code; nothing built).git merge-treeexits 0. CI: 3 success, 2 skipped. There's no WARP or hardware report. I agree with the standing changes request: capacity 1, stale docs and comments, no test, and the conflict with #3378. Points not raised yet:MUST
--renderrun that presents more than one plane takes the new branch ((present_composite_enabled() || planes > 1) ? ~0u). docs/startup-runtime.md on main keeps compositing opt-in "until a matched comparison on the same executable, with this change alone, shows what it does to a real present". The PR doesn't provide that comparison, and the docs still say the opposite. Either add the comparison, or put the behaviour behind a switch that defaults off.SHOULD
2. The PR has no fixture and no negative control. The body reports only that the build passes. A pure test of the selection, like
startup_present_planesin #3378, would pin theplanes > 1branch both ways.NIT
3.
git diff --check origin/main...<head>exits 2:d3d12_xs_device.cpp, trailing whitespace on the new comment line ("...to avoid black screens ").4. The new comment says "(common in some titles)", which no evidence in the PR supports. Describing the plane layout would be better. The PR title also lacks the
area: whatform used in the log (for exampleruntime: ...).Holding, not merging: standing changes request, plus 1.
AI-assisted.
@KelboLive on GitHub · 2026-11-29 16:16 UTC · original
Withdrawing this in favour of #3378.
The review point is correct. With
X2W_PRESENT_COMPOSITEunset,present_to_window(..., present_composite_enabled() ? window_planes : 1)still passes a capacity of one plane, and that capacity reachesPlaneCompositor::createon the first present. Selecting every plane inpresented_planes()therefore cannot make a second plane appear. This change altered the selection policy only, not the capacity.#3378 covers the same behaviour and closes that gap:
select_presented_planes()inpresent_planes.h, the presenter always receivingwindow_planes, a fixture instartup_present_planes_check.cppand the documentation update, with 4/4 passing on WARP. It cites this pull request.Nothing here was built or run.
@KelboLive on GitHub · 2026-11-29 16:16 UTC · original
Separately: my earlier review on this pull request — "LGTM — ready for approval from another maintainer… Safe to merge" — was wrong and should be disregarded. It was posted before I had checked the compositor capacity, and it does not reflect the code. GitHub does not allow deleting a submitted review, so this comment is the retraction. The maintainer's request for changes stands, and the work continues in #3378.
Pull request closed