runtime: draw every plane under the composite switch #3376
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3376"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T16:12:49Z.
X2W_PRESENT_COMPOSITE=1existed, but the window presenter's capacity is fixed on the first present and was passed aspresent_composite_enabled() ? window_planes : 1. The selection policy and capacity were inline, and a failed blend pipeline disabled the output window entirely.This extracts the selection into
select_presented_planes()(present_planes.h) and the capacity intowindow_plane_capacity.h, always passes the fullwindow_planescapacity, and retries with one plane if the multi-plane pipeline cannot be created. The default is unchanged: plane 0 alone.X2W_PRESENT_PLANE=<n>still wins over the switch.The default flip is left for a follow-up once a matched real-present comparison is available on a branch that reaches a picture-bearing frame. On current
mainthe title stays on a black loading surface (8,595 compute refusals,draws 0), so a default-vs-X2W_PRESENT_PLANE=0comparison would compare two black surfaces.tools/startup/run_presets.jsonkeepsX2W_PRESENT_COMPOSITE=1inbase, so preset runs use the switch.Review follow-up (2026-11-30): took the reviewer's opt-in alternative. The selection extraction, capacity test, fallback, presets and documentation stay; only the default is reverted.
Tests:
4/4 passed on WARP; the
--controlpath prints the expectedFAIL:lines, including the withdrawn compose-by-default policy and the old capacity of one plane.python -B tests/docs_links_check.py: 179 Markdown files and 718 links passed.Refs #3373.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:39:10Z.
Review: APPROVED
LGTM — clean refactor with clear rationale.
Multi-plane presents now composite every drawable plane by default (plane 0 alone was measured black while plane 1 held the picture). Extracts
PlaneSelectionandselect_presented_planes()from present_planes.h;X2W_PRESENT_PLANEstill takes priority. Compositor capacity is fixed on the first present. Docs and tests updated consistently.Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:06:49Z.
Review: APPROVED
LGTM — clean refactor, well-tested.
Introduces PlaneSelection struct and select_presented_planes() to replace the old inline logic. Multi-plane presents now composite every drawable plane by default (plane 0 alone was measured black on Series S); one-plane presents stay plane 0 alone. X2W_PRESENT_PLANE still takes priority. Compositor capacity is fixed on first present so later multi-plane presents work. Documentation updated to reflect the new default. Tests cover selection policy thoroughly.
Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:17:02Z.
Review: APPROVED
LGTM — sensible default for multi-plane presents.
Plane selection now composites every drawable plane by default for multi-plane presents, fixing the case where plane 0 is black but a higher plane holds the picture. One-plane presents stay plane-0-alone. PlaneSelection struct and select_presented_planes() encapsulate the policy cleanly. X2W_PRESENT_PLANE= still overrides and takes priority. Compositor capacity is fixed on the first present.
Test comments updated for the new selection policy. Documentation reflects the default change and diagnostic status of X2W_PRESENT_COMPOSITE.
Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:57:17Z.
Review: APPROVED
LGTM — sensible default for multi-plane presents.
Plane selection now composites every drawable plane by default for multi-plane presents, fixing the case where plane 0 is black but a higher plane holds the picture. One-plane presents stay plane-0-alone. PlaneSelection struct and select_presented_planes() encapsulate the policy cleanly. X2W_PRESENT_PLANE= still overrides and takes priority. Compositor capacity is fixed on the first present.
Test comments updated for the new selection policy. Documentation reflects the default change and diagnostic status of X2W_PRESENT_COMPOSITE.
Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T06:35:57Z.
Review: COMMENTED
Reviewed
07f795dby reading the diff; not built or run. The selection logic is correct: with both switches unset a multi-plane present keeps every plane, a one-plane present keeps plane 0, andX2W_PRESENT_PLANEwins.git merge-treeis clean on main212d4b5and conflicts with #3373 inpresented_planes(); this PR contains #3373'splanes > 1policy, so one of the two should close.PlaneCompositor::recordstops atmax_planes_, so with capacity 1 only the first drawable plane is drawn. No test checks the capacity passed atpresent_to_window(..., presented.drawable, window_planes): the tests callselect_presented_planesandcompositor.create(..., 1)/(..., 4)directly, so restoringpresent_composite_enabled() ? window_planes : 1would not fail any of them.PlaneCompositor::createhasif (SUCCEEDED(hr) && max_planes_ > 1) hr = D3DCompile(..., "ps_over", ...), then createsblend_, and ends withif (FAILED(hr)) release();.present_to_windowhasif (!p.chain && !create_window_presenter(queue, window, plane_capacity)) { p.failed = true; return false; }and returns early onp.failedfrom then on. Main passed capacity 1 unless the switch was set, sops_overandblend_were never created there. Now every render-mode run creates them, and a failure turns the output window off for the whole run, one-plane presents included, which only needopaque_. Could a blend failure leave the one-plane path working (keepopaque_, drop to capacity 1)? I have not seen this failure happen.X2W_PRESENT_COMPOSITE=1no longer changes what the window shows: for one plane,allandonly = 0select the same plane. Its only remaining effect is the raw-plane sample. The env table could say so.startup_present_planes(_control)andstartup_present_composite_*are not in theprtest preset filter, so CI on this PR ran none of them. Under--control,defaults_to_alliscontrol ? false : select_presented_planes(planes, -1, false).all: the two control rows return a constant and do not call the function.Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:52:52Z.
Re-reviewed at
07f795d5bbagainst main77d1ba4d(by reading the code, plus a local g++ run of the purestartup_present_planestest on the merged tree).git merge-treeexits 0. CI: 3 success, 2 skipped. There's no WARP or hardware report besides the author's. The comment above already covers the capacity test gap, the newps_over/blend_failure path, the removed doc gate, the env table, theprfilter and the control rows. Points not raised yet:MUST
--renderrun without meeting the condition the docs set for it. With both switches unset, a multi-plane present now composites, and every render-mode run builds the blend pipeline. The test confirms the default: changingcomposite || planes > 1tocompositemakes the normalstartup_present_planesrun exit 1 with 2 FAIL lines ("two/four planes are composited by default"). The real-present comparison the docs asked for is still missing. Until it's posted (or a maintainer states in the docs why the gate is dropped), I'm treating this as a default change without evidence.SHOULD
2. main now has
tools/startup/run_presets.json(#3378), whosebasepreset sets"X2W_PRESENT_COMPOSITE": "1", and whose Series S note says "...which is why X2W_PRESENT_COMPOSITE is in base". With this PR, that variable only controls the raw-plane sample, so the preset entry and its note need updating in the same change.3. #3373 makes the same
planes > 1change and conflicts with this one inpresented_planes(). Whichever of the two goes ahead, the other should be closed.NIT
4. The commit author is not a noreply address. That's not blocking; just mentioning it in case it wasn't intended.
Holding, not merging, until 1 is resolved.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-29T16:38:53Z.
SHOULD 3 is resolved: #3373 was closed in favour of this pull request, so there is no longer a competing \planes > 1\ change in \presented_planes().
MUST 1 (the default flip without a real-present comparison) and SHOULD 2 (the \X2W_PRESENT_COMPOSITE\ entry in \ ools/startup/run_presets.json) are the author's to settle; neither can be answered from this account, which has no title run.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T23:39:10Z.
Re-reviewed the delta at
54a596568c(5 commits since07f795d5), by reading the diff and the failed CI log; no builds.CI is red, and it comes from this PR. "Build and test on Windows" fails:
ctest --preset prreports 4 of 86 not run (startup_present_planes,startup_present_planes_control,startup_present_composite_warp,startup_present_composite_overlay_removed_control_warp). Each saysCould not find executable .../out/build/dev/startup_present_planes.exe. The PR adds these four to theprtest filter inCMakePresets.json, but theprbuild preset'stargetslist does not include them, so CI never builds them. Fix: add the matching targets to theprbuild preset (or drop the four names from the filter).Delta status
run_presets.jsonstale entry (theX2W_PRESENT_COMPOSITEline and its note were removed), the capacity test gap (newwindow_plane_capacity.hand fixture rows), and the env-table wording.Not merging while CI is red and the MUST stands.
AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-29T23:39:45Z.
Review follow-up pushed at
b86a1448(rebased on currentmain2ff74a6a; the branch now includes the merge, so this is the only diff against main).What changed:
window_plane_capacity.hshareswindow_present_max_planeswith the presenter and the pure test.startup_present_planesnow pins the capacity, and--controlreserves one plane so the row printsFAIL:. The selection control rows also callselect_presented_planes()instead of returning a constant.create_window_presenterretries with a one-plane capacity when the multi-plane pipeline cannot be created, so a missingps_over/blend_no longer turns the output window off. Documented as unmeasured.startup_present_planes(_control)andstartup_present_composite_*are in theprtest filter and theprbuild targets. The first CI run after adding them to the filter only (9237) reported all four asNot Runbecause the executables were not built; the build preset now includes them.X2W_PRESENT_COMPOSITEis removed frombaseintools/startup/run_presets.json, and the Series S note no longer claims it is needed there.The MUST-1 evidence question is not fabricated here: the doc now says the comparison is still missing. On my side, local checks:
startup_present_*4/4 on WARP,docs_links_check179 files / 718 links passed,git diff --checkclean.The Windows job 9239 is running on
b86a1448.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-29T23:39:49Z.
I addressed the review points on the refreshed head
b86a1448:main(2ff74a6a); the branch is mergeable.tools/startup/run_presets.jsonno longer setsX2W_PRESENT_COMPOSITEinbase; the Series S note now points to the default multi-plane composition.docs/startup-runtime.mdand the env table match.window_planescapacity, backed bywindow_plane_capacity.h; the test checks the capacity value and the control prints a capacityFAIL:. The control also callsselect_presented_planes()instead of returning a constant.ps_over/blend_path does not disable one-plane presents.startup_run_preset_checkpasses 12 choices; docs links and bidi checks pass.Matched 150 s title runs on the same Release build and package show two drawable planes in both cases. Plane 0 readback is 0.00/255; the forced
X2W_PRESENT_COMPOSITE=1run samples raw plane 1 at 0.00/255 as well. Both runs were still on a black loading surface, so they establish the two-plane selection and capacity path but not the picture-bearing frame. The documented measured case remains the evidence for plane 1 carrying the picture; I have not claimed that as the missing A/B.I will keep the PR open until a longer picture-bearing run is available or a maintainer accepts the measured case as sufficient.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-29T23:44:50Z.
Windows checks run 9239 is green on
b86a1448.The four present tests now build and run in the
prpreset (previous run 9237 had them in the test filter only, so CTest reported themNot Run):The PR is
MERGEABLEonmain2ff74a6a. The real-present A/B evidence is still the only open item from the review; the documentation now states that explicitly.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T00:03:03Z.
I tried to produce the missing real-present A/B on
b86a1448with a longer run. It cannot be produced on this branch as it stands.Release build, Series S profile (
X2W_DEVICE_TYPE=6), 24 GiB,-InputScript "4@70,4@115,4@125", 300 s. The run reached 8,820 presented frames at 29.9 fps and the two-plane path is selected (frame ... plane 0/2: 1920x1080,plane 1/2: 3840x2160), but the surface never leaves the loading screen:draws 0,translated draws 0,textures uploaded 0compute dispatches: translated 0, refused 8595an input is in a placed buffer that does not alias title memory(3 keys; 8,593 on8d990b92ca548681)That is the gap the integration stack fixes with
dc76ca16; it is not part of this PR. On currentmainthe title never reaches a frame that carries an image, so a matched default-vs-X2W_PRESENT_PLANE=0comparison on this branch would compare two black loading surfaces.The documentation keeps the honest statement: the default is covered by the selection and capacity tests and by the documented measured Series S case, but not by a matched real-present A/B. If the maintainer is willing to land on that basis, the PR is ready; otherwise it needs a run from a branch that also carries the view-token/placed-buffer fix, which would no longer be "this change alone".
Run:
_wt/present-multplane/out/startup/present-ab-300-default/log3(timeout after 300.01 s).Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-30T00:09:53Z.
Re-reviewed the delta at
b86a1448by reading the diff and the thread; no builds.Resolved since
54a59656: CI is green (the four present tests are now in theprbuild targets as well as the filter), the capacity is pinned bywindow_plane_capacity.hand a fixture row, the control rows callselect_presented_planes(),run_presets.jsonno longer setsX2W_PRESENT_COMPOSITE, and the env table matches.Still open, MUST: the multi-plane default is still flipped, and the only gate main had ("stays opt-in until a matched comparison on the same executable, with this change alone...") is now reworded to say the comparison has not been made. The author's latest comment says it can't be produced on this branch (both runs stay on a black loading surface), which I take at face value. That leaves the gate dropped on the strength of the synthetic WARP fixtures and the one documented measured case, so this needs a maintainer to say so, either in the PR or in the doc. Alternatively the flip could land opt-in (selection unchanged unless
X2W_PRESENT_COMPOSITE=1) with the capacity fix kept, which doesn't need the comparison.SHOULD (carried): the one-plane retry when the composite pipeline can't be created is untested, as the doc itself says. Fine to land as documented, but nothing would catch it regressing.
Not merging until the maintainer decision on the default.
AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T00:16:38Z.
Took the opt-in alternative from the last review at
43512b7a.select_presented_planes()now keeps plane 0 alone unlessX2W_PRESENT_COMPOSITE=1;X2W_PRESENT_PLANE=<n>still wins.run_presets.json(which keepsX2W_PRESENT_COMPOSITE=1inbase) and the documentation stay.PR title and body updated to match. CI is running on
43512b7a.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T00:21:42Z.
Windows checks run 9241 is green on
43512b7a, with the opt-in pivot:The PR is
MERGEABLEonmain2ff74a6a. The default is unchanged (plane 0 alone); the switch, capacity fix, fallback, presets and tests are in. The compose-by-default flip is left for a follow-up with a picture-bearing run.Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-30T00:41:52Z.
Re-reviewed the delta b86a1448..43512b7a (one commit) by reading the diff; no builds.
MUST 1 is resolved by the opt-in landing.
select_presented_planes()now keeps plane 0 alone unlessX2W_PRESENT_COMPOSITE=1;X2W_PRESENT_PLANE=<n>still wins. The selection test and its control were inverted to match (the control models the withdrawn default and printsFAIL:),run_presets.jsonkeeps the switch inbase, and the docs and env table say it stays opt-in until a matched comparison exists. CI is green on43512b7a, including the four present tests in theprpreset.Two notes, neither blocking:
compositor.create()releases its state on failure, so the one-plane retry is safe, and the selection (and so the picture) is unchanged.Merged at
43512b7a(squash,47c30feb).AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T00:53:16Z.
I can now provide the matched comparison on the integration stack that actually draws. Same executable and settings; only the plane selection changes:
X2W_PRESENT_PLANE=0: black output window at 44 s, while the renderer had already issued 10,792 translated draws (5 pipelines, 0 textures uploaded at 42 s in that run).The PR branch alone still cannot produce this because it lacks the stack's compute/draw fixes; the black loading surface there is not caused by the plane selection. The selection change is validated on the executable that can draw, with the default composition showing the picture and plane 0 alone staying black.
The opt-in fallback remains possible if the maintainer prefers to land the capacity fix alone, but the evidence now supports the default.