xshader: keep tb_cubeid's face numbers in float #643
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/643"
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-01T21:44:26Z.
tb_cubeid(thev_cubeid_f32helper) chose its face number withselect(z < 0.0, 5.0, 4.0)and the like. HLSL types aselectof two untyped literals asdouble, so DXC computed the face in doubles, converted it to float, and marked the program as using double-precision floating point, at-O0and-O3alike. A host without doubles (vkd3d-proton reports none without f64 denormal support; Metal has none) refuses every such pipeline. Results were unchanged: 0 to 5 convert exactly.The literals are now
ffloats. Of the translator's helpers this was the onlyselectwith two literals; the?:forms elsewhere stay float.Every translation changes.
push_helperswrites the cube helpers (tb_cubeidwithtb_perm_byte,tb_cubemaand the rest) into every program, whether it uses them or not, so this edit changes the HLSL of every program, andhost_profiles.txtis re-recorded (all 58 lines). DXC drops the unused helper, so only programs withv_cubeid_f32get different DXIL, but the DXIL store is keyed by HLSL, so every cached shader recompiles once. If that cost needs to wait, this can ride along with the next change that touches every translation. Emitting the cube helpers only for the instructions that call them would be a separate change; it changes every program's HLSL too.Tests
cube_face_ids_need_no_doubles(src/tests/hlsl/rdna2_alu_gaps.rs) translates av_cubeid_f32program, checks the literals, and withDXCset compiles it and checks that DXC declares no double-precision use. It fails on main.host_profiles.txtre-recorded withTUXBOX_BLESS_PROFILES=1, as the test asks.python tuxbox.py check --no-gpu:Evidence: TuxBox check of e4e3d44d0974, no uncommitted changes, no GPU checks: 13 passed, 0 failed, 0 not runProposal and discussion: #641. Draft until that is agreed. Refs #533.
🤖 Generated with Claude Code