d3d12: translate console depth format 118 in allocation queries #584
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/584"
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 brcly/TuxBox. Originally posted by csj0oe on 2026-11-30T08:02:27Z.
What
GetResourceAllocationInfoansweredUINT64_MAXfor a 2560×1440 console-depth resource (format 118, flags0x80300006). Console format 118 isD16_UNORM_S8_UINT; the host has no 16-bit depth with stencil and must be asked about the format it will actually create.host_descriptionnow translates the format throughformat::host_formaton every path, not only when console flag bits are present, and dropsALLOW_UNORDERED_ACCESSfor a depth image (a desktop depth image cannot also be UAV; the size is unchanged).info2uses the same description instead ofdepth::primaryalone.Noneas before.Caveat
The recorded evidence names width, height, format and flags but not the layout. With
Layout == UNKNOWNthe existing pair mapping already handled 118, so the sentinel implies the forwardedROW_MAJORcase this fixes. If a future log showsallocation requires … layout=0x100…, the console-layout plane calculator is the place to fix instead — that path accepts only formats 19/20/44/45, 39/40 and 53/55.Tests
console_depth_allocation_descriptor_takes_a_host_format(CPU) asserts the translation, the UNKNOWN pair mapping and an untouched desktop format.console_depth_allocation_descriptor_answers_a_size_on_both_slotsis hardware-gated and not run here.Not run
NVIDIA, and the D3D12/Lanes GPU suites that
CONTRIBUTINGasks for on aruntime/d3d12change; the hardware-gated test above did not run here.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T09:50:43Z.
Thanks. Asking the host about the format it will actually create is the right principle. Before merging I need two things, though:
UINT64_MAXfor 2560×1440, format 118, flags0x80300006come from: which build, which scene, and which log line? I can't find it in our recent boots. Your caveat says the layout isn't known and that the fix depends on it being the forwardedROW_MAJORcase. So please capture a run that logs the layout, and show the query answering a size with this change.host_descriptionnow runshost_formatand the UAV drop on every description, andinfo2now uses it too. So every console format thathost_formattranslates gets a different size and alignment answer than before. The title places its resources by these answers, and that's the kind of quiet change that broke games after #527. Please either:host_formatchanges, the answer now matches what resource creation actually allocates. A table of before and after for each translated format would do.The hardware-gated test didn't run on your machine, so please also run it on a card. I can cover NVIDIA once the two points above are settled.
Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-30T10:19:14Z.
Closing, with the reason measured rather than argued.
The evidence for this PR is a recorded
blocking_callin our evidence file — a 2560x1440, format 118, flags0x80300006GetResourceAllocationInfothat answeredUINT64_MAXon 23 November, on a build I cannot attribute to a particular scene, and without the layout field. You were right that it is not a log line.I then narrowed the change to depth resources only, so colour formats keep the answers they had, and ran the tests on this machine: both unit tests pass, but the hardware-gated one fails — with the translated
D32_FLOAT_S8X24description,GetResourceAllocationInfostill answersUINT64_MAX(assertion left != right failed: host cannot size the reference depth image, both sides18446744073709551615). So on the one card I have, the change does not turn the sentinel into a size, and I will not ask you to merge a fix whose premise I cannot show.The trace that would settle it is opt-in and now wired for the next instrumented run:
TUXBOX_TRACE_ALLOCATION_BYTES=invalidprintsallocation trace <kind> caller=… bytes=… align=…plusformat flags layoutper item. If it shows a realformat=118query answeringUINT64_MAX, the narrowed change comes back with that line and the layout, and the sentinel's cause is a fact instead of an inference. Branch kept.Pull request closed