shader: accept inline constants in packed binary16 arithmetic and min/max in direct DXIL #3226

Closed
opened 2026-11-27 23:57:07 +00:00 by legacy-code-archaeologist · 0 comments
legacy-code-archaeologist commented 2026-11-27 23:57:07 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-27T23:57:07Z.


Refs #2935 and #3224.

In src/gfx1013_direct_compute.inl, DirectCompute::packed_f16_alu() (v_pk_add_f16, v_pk_mul_f16, v_pk_fma_f16) currently refuses every inline constant except 128 (0) and 255 (literal) with "unsupported packed binary16 arithmetic source", and DirectCompute::packed_minmax() (v_pk_min_f16, v_pk_max_f16) likewise refuses inline binary16 float constants 240..248 and non-zero inline integers 129..208 with "unsupported packed 16-bit min/max source".

As noted on #3224 (Rank 3 follow-on after #3220), shaders using v_pk_*_f16 with inline binary16 float constants (0.5, -0.5, 1.0, -1.0, 2.0, -2.0, 4.0, -4.0, 1/(2*pi)) or inline integers (0..64, -1..-16) hit this refusal.

Scope

  • Accept inline binary16 float constants (240..248, with [31:16] = 0 per gfx1013 hardware) and inline integer constants (128..208, 32-bit sign-extended) in packed_f16_alu() and packed_minmax() (keeping float 240..248 refused on integer v_pk_min_{i,u}16 / v_pk_max_{i,u}16).
  • Keep existing refusals for vcc_lo/vcc_hi, m0, exec_lo/exec_hi, scc, clamp, reserved bits, and non-default FP16 MODE.
  • Add source-built IR, controls, compute, and pixel tests pinning all 9 inline float constants, high-half zeroing (op_sel_hi=1), neg_lo/neg_hi, single-rounding FMA tie witnesses with 0.5, inline integer constants, and kept refusals.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6656369337 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3226). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-27T23:57:07Z. --- Refs #2935 and #3224. In `src/gfx1013_direct_compute.inl`, `DirectCompute::packed_f16_alu()` (`v_pk_add_f16`, `v_pk_mul_f16`, `v_pk_fma_f16`) currently refuses every inline constant except `128` (`0`) and `255` (literal) with `"unsupported packed binary16 arithmetic source"`, and `DirectCompute::packed_minmax()` (`v_pk_min_f16`, `v_pk_max_f16`) likewise refuses inline binary16 float constants `240..248` and non-zero inline integers `129..208` with `"unsupported packed 16-bit min/max source"`. As noted on #3224 (Rank 3 follow-on after #3220), shaders using `v_pk_*_f16` with inline binary16 float constants (`0.5`, `-0.5`, `1.0`, `-1.0`, `2.0`, `-2.0`, `4.0`, `-4.0`, `1/(2*pi)`) or inline integers (`0..64`, `-1..-16`) hit this refusal. ### Scope - Accept inline binary16 float constants (`240..248`, with `[31:16] = 0` per gfx1013 hardware) and inline integer constants (`128..208`, 32-bit sign-extended) in `packed_f16_alu()` and `packed_minmax()` (keeping float `240..248` refused on integer `v_pk_min_{i,u}16` / `v_pk_max_{i,u}16`). - Keep existing refusals for `vcc_lo`/`vcc_hi`, `m0`, `exec_lo`/`exec_hi`, `scc`, `clamp`, reserved bits, and non-default FP16 MODE. - Add source-built IR, controls, compute, and pixel tests pinning all 9 inline float constants, high-half zeroing (`op_sel_hi=1`), `neg_lo`/`neg_hi`, single-rounding FMA tie witnesses with `0.5`, inline integer constants, and kept refusals. AI-assisted.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#3226
No description provided.