{ "piece": "PS system inputs", "status": "gpu_verified", "rank": 25, "sentences": [ "v0–v1 = barycentrics (consumed by `v_interp`, which becomes attribute inputs).", "**v2.. = the `SV_Position` components the shader reads, packed in order**.", "Verified on 2,531 of 3,000 PS: the VGPRs they read before writing equal exactly the position components their input signature reads.", "Filled from `FragCoord`: xy/z directly, and **w directly too**, because AMD's position-w register holds 1/w (Mesa lowers `load_frag_coord_w_rcp` straight to `frag_pos[3]`, `ac_nir_lower_intrinsics_to_args.c`), the same as Vulkan's `FragCoord.w`.", "**Front face** follows the used position components when the signature declares `SV_IsFrontFace`, as ±1.0 (Mesa: `load_front_face` = `front_face > 0`).", "Only enabled inputs are packed, in hardware order (Mesa `radv_shader_args.c`: barycentric pairs, POS_X/Y/Z/W, FRONT_FACE, ANCILLARY, SAMPLE_COVERAGE, POS_FIXED_PT).", "That explains the earlier \"unverified\" shaders: 102 read pos.xy + front face, and 76 read pos.x/y/w + front face.", "**Raw barycentric reads** (321 PS, e.g.", "`v_readfirstlane_b32 s41, v1`): AMD interpolates P = P0 + i(P1 − P0) + j(P2 − P0), so i/j are the weights of vertices 1/2, which is `BaryCoordKHR.y`/`.z` (`VK_KHR_fragment_shader_barycentric`).", "GPU-checked with `runtime/test/shaders/ps_bary.asm`: raw i/j equal the interpolated weights on every pixel.", "The pair is perspective-center, the only pair this layout models; that holds for every corpus PS (row \"PS interpolation modes\").", "A PS that reads any other unexplained register inside the system-input range is still rejected (none left in the corpus).", "Reads past the last hardware input are values undefined on some path, so zero stands in for them.", "All register arrays start at zero, so translated shaders are deterministic." ] }