Support absolute-value operands in pixel shader translation #89

Manually merged
github merged 5 commits from gh-pr/89/head into gh-pr/89/base 2026-11-26 21:26:23 +00:00
Owner

@⁠RonLogic on GitHub · 2026-11-21 15:48 UTC · original
RonLogic:shader-abs-operand → main · +54 −8 · 4 files · 5 commits · merged 2026-11-21 16:54 UTC

Summary

The pixel shader lowerer rejected the AMDGPU absolute-value source modifier on an otherwise supported floating-point instruction. This change translates both |v12| and abs(v12) to HLSL abs and reuses the existing operand validation.

The synthetic fixture computes abs(0.5 - red) from a sampled texture. The reference covers inputs on both sides of 0.5. The renderer reports a pixel mismatch when the modifier is removed from the fixture. The new fixture also runs through the existing LLVM 15 assembly and disassembly test in CI.

Verification

ctest --test-dir out/build/shader-native-prompt --no-tests=error -R '^pixel_aot_(warp|hardware)$' -V

Both tests passed on Windows with an RTX 4070 (driver 32.0.16.2124) and Microsoft WARP. Each backend matched all four channels of 4,096 pixels exactly. The fixture is generated from source and uses no game data.

AI-assisted. The Windows results were verified locally.

**@⁠RonLogic** on GitHub · 2026-11-21 15:48 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/89) `RonLogic:shader-abs-operand` → `main` · +54 −8 · 4 files · 5 commits · merged 2026-11-21 16:54 UTC ## Summary The pixel shader lowerer rejected the AMDGPU absolute-value source modifier on an otherwise supported floating-point instruction. This change translates both `|v12|` and `abs(v12)` to HLSL `abs` and reuses the existing operand validation. The synthetic fixture computes `abs(0.5 - red)` from a sampled texture. The reference covers inputs on both sides of 0.5. The renderer reports a pixel mismatch when the modifier is removed from the fixture. The new fixture also runs through the existing LLVM 15 assembly and disassembly test in CI. ## Verification ```powershell ctest --test-dir out/build/shader-native-prompt --no-tests=error -R '^pixel_aot_(warp|hardware)$' -V ``` Both tests passed on Windows with an RTX 4070 (driver `32.0.16.2124`) and Microsoft WARP. Each backend matched all four channels of 4,096 pixels exactly. The fixture is generated from source and uses no game data. AI-assisted. The Windows results were verified locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:26:22 +00:00
github manually merged commit 04b8b48f01 into gh-pr/89/base 2026-11-26 21:26:23 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.