shader: emit binary32 float literals in graphics HLSL #3568
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3568"
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 R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-30T09:10:34Z.
Problem
tools/startup/gfx2hlsl.pyemitted unsuffixed floating-point literals (such as1.0,0.0,255.0,0.0625,6.283185307), which DXC/HLSL can treat as double-precision literals or trigger implicit conversion issues in graphics HLSL.tests/startup_gfx2hlsl_f16_alu_check.pyevaluated lowered HLSL expressions in Python without stripping thefsuffix from float literals.Fix
fsuffix to binary32 floating-point literals emitted bytools/startup/gfx2hlsl.py.tests/startup_gfx2hlsl_vcvt_omod_check.py,tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py, andtests/startup_gfx2hlsl_f16_alu_check.py(plustests/checks/python-linux/gfx2hlsl-vcvt-omod.txt) to expect and parse binary32f-suffixed float literals.Verification
python3 -B tests/startup_gfx2hlsl_vcvt_omod_check.py(passed)python3 -B tests/startup_gfx2hlsl_f16_alu_check.py(passed)python3 -B tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py(passed)python3 -B tests/bidi_controls_check.py(passed)python3 -B tests/docs_links_check.py(passed)git diff --check origin/main..HEAD(passed)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-30T09:10:47Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
78fe2beℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-30T09:24:23Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
78fe2bec9aℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-30T09:24:23Z.
Code review location:
tools/startup/gfx2hlsl.py; line 3017The
python-linuxjob in.github/workflows/windows.ymlstill runs several checks that were not adapted to these suffixes. In particular,tests/startup_gfx2hlsl_sdwa_cvt_check.py::eval_emitted_v0sends the generated* 0.5fexpression directly to Pythoneval, raisingSyntaxError: invalid decimal literal;startup_gfx2hlsl_fma_mix_check.pyandstartup_gfx2hlsl_float_transcendental_check.pyalso fail because their golden strings and mutation patterns still require unsuffixed literals. All three checks pass on the parent revision. Update the remaining evaluators and literal-sensitive expectations alongside the emission change so the standard CI regression suite continues to pass.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-30T09:30:28Z.
Code review location:
tools/startup/gfx2hlsl.py; line 3017Fixed in
831b7e612and96c1506ed.