startup: log the sampled presented colour when it changes #3492
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!3492
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3490"
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?
@Leyukaka on GitHub · 2026-11-29 17:38 UTC · original
Leyukaka:runtime-present-colour-log→main· +139 −41 · 6 files · 1 commits · merged 2026-11-30 08:45 UTCRefs #3479 (item 5).
Default change: in render mode with
X2W_PRESENT_SIGNATURE_EVERYunset, the log now gets onex2w-present sampled colourline for the first sample and one per colour change.X2W_PRESENT_SIGNATURE_EVERY=0turns it off.Why
In one long local run of the application the picture went from a uniform fill to black, and no log line says so. The sampled RGBA was logged only under the red-producer diagnostic.
What changes
X2W_PRESENT_SIGNATURE_EVERY=<n>or a script picture wait), the colour comes from the signature sample.X2W_PRESENT_SIGNATURE_EVERY=<n>the bound is one line per sample.X2W_PRESENT_COMPOSITE=1) never log.published && red_producers().enabled() && last_format == R8G8B8A8_UNORM), and it gets the same four bytes as before for that format.Samplernow sets the last-sample fields only whenMapsucceeds and returns a pointer; a failedMappublishes nothing, as before.present_signatureis serialised by a mutex. Lock order is always the outer lock (signature mutex or the readback's), then the colour-log mutex.docs/startup-runtime.mddescribes the line.Tests
New
startup_present_colour_warp(tests/cmake/startup_present_colour.cmake), drivingstartup_present_producerthrough uniform clears:X2W_PRESENT_SIGNATURE_EVERYcolour(BGRA8)1colour-readback(RGBA8)colour-readback09 passed, 2 skipped, on
7684a835(base26df1826),X2W_WITH_OPUS=OFF. The two skips arestartup_present_signature_held_source_warpandstartup_present_signature_unheld_source_control_warp("SKIP: no D3D12 debug layer"); they were not run.Mutations, each rebuilt and run against
startup_present_colour_warp:Not covered
Merges cleanly with #3482 and #3484 (
git merge-tree --write-tree).@lukaslw-lab on GitHub · 2026-11-30 08:13 UTC · original · approved these changes
Reviewed
7684a835by reading the diff; not built or run.Verdict: approve. The colour log does what the body says and adds no GPU work. One SHOULD, which can follow later. No MUST.
d3d12_xs_device.cpp:2155). On a title's moving picture, the centre texel differs at almost every sample, so the default mode logs about one line per 60 presents all run. The fill-to-black change from #3479 then sits among lines that carry no signal. A small per-channel tolerance would keep it to real changes, as the luma signature does with its 12-level threshold. Uniform clears in the test cannot show this.present_signature_sampler.h:129), andread_back_presentedcopies the whole surface and returns early for formats other than 8-bit RGBA/BGRA (:2218). Both usesampled_row(cells_y / 2, Height)atWidth / 2.frame % 60 == 0is always a readback frame (readback every 6 or 60 presents,:7815).X2W_PRESENT_SIGNATURE_EVERY=0returns before anything runs. When it is set to n, the fallback is disabled.capture_centeralways true is inert there. TheR8G8B8A8_UNORMgate stays,sampled_rgbareturns the raw bytes forrgba8, and the test asserts nox2w-red sampleline.Tests:
startup_present_colour_warpcovers the signature path (BGRA8), the readback fallback (RGBA8) and the off switch, and both mutations fail it. CI did not run it: theprpreset's include list (CMakePresets.json:51) has neither it norstartup_present_producer_*, and/O2was skipped on the PR. The body's local run is the only one at this head.