Record no device-nan-encoding for a color output that only ever returns NaN-free constants
A fragment function's color output to a half-float attachment recorded PrecisionNote::DeviceNanEncoding wherever the device's conversion stores a NaN otherwise than Metal, even when every value the function returns there is a constant with no NaN lane, which stores no NaN. Texture writes already skip the note for such a constant texel (texture::holds_no_nan); color outputs now apply the same structural rule. stage_io::returns_no_nan follows each `ret` of the function to the output's member (through insertvalue chains and aggregate constants), and color_write::plan, called from the output-variable path and from the storage-form path, leaves the note out when every return holds such a constant. Any computed, undef, argument or partly unknown member keeps the note. Per-site audit of the device-nan-encoding notes on MoltenVK on the M3 (the reims strict Mac tests), with the translator CLI over each site's stages: - (a) undefined tests x3 (xr_constant_fragment and the other constant-colour fragments): their outputs are NaN-free constants, so the note was wrong there. Fixed here. - (c) encode_render x2 (sweep_fragment, sweep_half_fragment): computed outputs that sweep through NaN values. The device stores its own NaN encoding, so the note stays. - (c) rgbx x3 (rgbx_write_half, store_half, read_write_half, and the NaN clears and half NaN writes): deliberate NaN texel writes. The note stays. - (c) slice_write_repro x1 (slice_write, slice_write_l0): computed texel writes. The note stays. New public fixture ncw_constant_colors (our own MSL, compiled by scripts/regen-air-fixtures). It covers a half and a float constant colour, a constant NaN colour, a computed colour, and a two-member struct whose member 0 is a constant and member 1 computed. The new test engine_link::constant_colors_without_a_nan_record_no_nan_encoding checks, on the lavapipe and moltenvk-m3 profiles, that the note is recorded exactly for the NaN constant, the computed colour and the pair's computed member, and that each stage links and validates. docs/API.md's device-nan-encoding entry states the rule. SEMANTICS_VERSION goes to 1963 because the recorded notes change. The golden tables need the new fixture's rows, re-blessed on development. Verification: the new test and the touched suites run in the branch's next CPU job. (cherry picked from commit 2d436ebc2963f1aac1854b850ff1808e654c61f3)
This commit is contained in:
1 parent
ca5fecf79c
commit
75228b052b
12 files changed
+408
-10
No files matched your search
+3
-1
@@ -3205,7 +3205,9 @@ bound.
|
||||
a fragment function computes into a 16-bit float attachment through the pixel interlock: a NaN
|
||||
of the blend is the device's arithmetic's, which the storage image's store converts, where Metal
|
||||
stores every NaN of the blend as `0x7e00`. A texture write records it where the stored NaN is the
|
||||
device's: a constant texel none of whose lanes is a NaN records nothing. **Exempt:** a `half`
|
||||
device's: a constant texel none of whose lanes is a NaN records nothing. So does a fragment
|
||||
function's color output where the device's conversion stores its NaN, but one every return of
|
||||
which holds such a constant records nothing. **Exempt:** a `half`
|
||||
texel's write to a 32-bit float storage image on a profile that takes
|
||||
`DriverDeviation::MetalNanMoves` (the image stores the widened `float`'s bits, Metal's
|
||||
`0x7fc00000`; the module requires `VkProperty::MetalNanMoves`), and a `float` or `half` texel's
|
||||
|
||||
Reference in new issue
Block a user