docs(agc): measure the rounding of a halfway array layer #16557
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16557"
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 boykopovar/AnyPS5. Originally posted by brumskysb on 2026-11-07T05:04:20Z.
What
Closes the "RDNA's rounding of a halfway layer is unmeasured" clause in the "1D arrays past maxImageArrayLayers" entry.
Measured on gfx1036 (driver 31.0.22044.1): the layer coordinate is an absolute index, and a halfway layer rounds half to even — layers 0.5, 1.5 and 2.5 of a four-slice array select slices 0, 2 and 2. Half-up would give (1, 2, 3) and truncation or half-down would give (0, 1, 2), so those three inputs separate every candidate rule. Integer layers 0-3 read their own slice, and −1.0 and 5.0 clamp to the first and last slice.
That matches the half-to-even rule the entry already attributes to Vulkan's array-layer selection, which the emulation reproduces — the measurement confirms the rule rather than changing it.
Evidence (script, dump, notes): https://gist.github.com/brumskysb/619a3ea0d55a5a19bc3ccad01e45c8f9
Tested
gfx1036, driver 31.0.22044.1, Windows 11; harnesstools/hw-oracle, wave32, 16 lanes per dispatch.DEPTH3), texel values0x3F000000 + slice*16 + x, sampled withimage_sample_lzthrough a nearest clamp-to-edge S#.Notes
debt-lengthwarning is expected; it was 988 before. Nothing was trimmed, and the "a NaN layer reads slice 0" clause is untouched because no NaN layer was dispatched here.ImageOneDimensionalArray.cpp(nearbyintthen clamp). Sampling at normalized slice centres therefore dispatches layers 0.125/0.375/0.625/0.875, which round half-to-even to 0/0/1/1 and look exactly like an array with two slices. The descriptor was correct; the coordinate was not.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attached to this PR)Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T17:48:48Z.
Review: COMMENTED
Read
467eaa9ecbagainstmain.Correctness. The entry is still current on
main(docs/dev/debt/libSceAgcDriver.md:394, "unmeasured"). The behaviour it records matches the code:SpirvImageEmitter.cpp:LayerRowsCoordappliesGLSLstd450RoundEvento the layer and thenNClampto[0, rows/2 - 1], so 0.5, 1.5, 2.5 select slices 0, 2, 2 and -1.0 / 5.0 clamp to the first and last slice of a four-slice view, andNClampreturns 0 for a NaN. The code and the measured rounding agree, so the sentence "as Vulkan's array layer selection does" now also holds for the hardware. The measurement itself is not checkable here.Not run here; this is from reading the code.
AI-assisted: yes.