xshader: fill the root constants of rooted vertex and pixel programs #611
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/611"
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 NickStallman on 2026-12-01T06:09:05Z.
A vertex or pixel program translated against a root signature had its root constants bound for one shape only: a pixel program whose root is one table followed by them. Otherwise the registers the console fills with them started at zero, with no refusal, and the program was accepted.
The program's own records say where its constants are: exactly one user-data row (1 to 32 dwords), one used-resource row with the same register and location, and one constant-buffer binding at that register. The location numbers the root parameter, which must hold constants, at least as many, and be visible to the stage. They are bound at the register and space that parameter has.
A rooted vertex or pixel program is now refused if its constants aren't found and either a used-resource row says it uses them or the translator sees one of their registers read. The record matters because the translator's list of registers read misses some reads, such as the high half of a 64-bit scalar source. A program whose constants are read and never filled also gets a header line naming them (
// unresolved inputs: s10 s13 (root constants)), and preparation reports it. Compute, mesh, amplification and packed roots are unchanged.Refs #533 (claimed there).
What it changes in a title
In a title we traced, the lighting draws take a material index from a root constant and depth-test EQUAL against it; with the constant at zero they could only match material 0. The surface programs also read their material records at an offset from a root constant. In an integration build with this change, captures of one run (RTX 5090, 620.70.10, GE-Proton11-15) showed surface-colour targets that had been black now filled: of pixels drawn with a surface, albedo exactly zero went from 76–85% to 22%. Lighting needed a second fix (#613); with both, and #612, the picture became recognisable. No device loss, no refused submission.
Measured
717a74c4): 12,878 change (pixel 11,011, vertex 1,449, linked pixel 418). None is newly refused or newly accepted; the record-based refusal was counted before it was enabled: 0 of 23,421 rooted vertex/pixel requests and links have a used row with unresolved constants. These are translations, not programs: many appear twice, with and without the index map. The head's output is identical to the first commit's for all 21,051.raster-vertex-constants: two tables then four constants; vertex depth from a constant under an EQUAL test, four draws, and the pixel result XORs all four. Passes on both cards (below). Control on the RTX 5090 with the scenario but without the translator change:lanes-selftest FAIL raster-vertex-constants: material 7, texel 0,0: expected 0x73b4e286, found 0.fb17e160(after #523's codegen rewrite): 21,054 requests and links, 12,879 change (one link request is new since the first survey), 698 refused before and after, none newly refused or accepted. DXC -O3 and dxv over all 12,879: 11,285 distinct programs compile and validate, 0 failures.Evidence: TuxBox check of cd8f0c190fba, no uncommitted changes, no GPU checks: 13 passed, 0 failed, 0 not runpython tuxbox.py checkof7d9a9938(GE-Proton11-15): RTX 5090 (10de:2b85, 620.70.10) 209 pass, 0 fail; AMD iGPU (1002:13c0, RADV) 208 pass, 0 fail.Evidence: TuxBox check of
7d9a9938e3, no uncommitted changes, GPU 10de:2b85: 17 passed, 0 failed, 0 not runEvidence: TuxBox check of
7d9a9938e3, no uncommitted changes, GPU 1002:13c0: 17 passed, 0 failed, 0 not runNot covered
s_swappc, the layoutemitter/bindings.rsdescribes) and read from the relocated registers: found by a synthetic probe, not in any recorded program. Its relocated register still reads zero.🤖 Generated with Claude Code