Shaders: lower standalone v_interp_p1_f32 #68

Open
Artking175 wants to merge 2 commits from upstream-pr/68 into main
Artking175 commented 2026-11-25 08:09:11 +00:00 (Migrated from github.com)
First-time contributor

Imported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T07:59:04Z.


A pixel shader can use the result of v_interp_p1_f32 without a matching v_interp_p2_f32. I/O raising now records those first halves as weighted evaluations, so the existing lowering computes P0 + i(P1 - P0) from the vertex values. First halves already handled by a pair keep the existing lowering.

The regression test exports the first half directly. Before this change it reproduced “the first half of an interpolation”, the diagnostic reported in #55. The exact shader from that report still needs a game run to verify.

cargo test --locked -p victory-shader passed on macOS (171 passed, 2 ignored). cargo check --locked -p victory-shader --tests --target x86_64-pc-windows-msvc passed. No game files were used.

<!-- greyfinch-sync:Zettrox/ztrx:issue:6599915302 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/68). Originally posted by [Artking175](https://github.com/Artking175) on 2026-11-25T07:59:04Z. --- A pixel shader can use the result of `v_interp_p1_f32` without a matching `v_interp_p2_f32`. I/O raising now records those first halves as weighted evaluations, so the existing lowering computes `P0 + i(P1 - P0)` from the vertex values. First halves already handled by a pair keep the existing lowering. The regression test exports the first half directly. Before this change it reproduced “the first half of an interpolation”, the diagnostic reported in #55. The exact shader from that report still needs a game run to verify. `cargo test --locked -p victory-shader` passed on macOS (171 passed, 2 ignored). `cargo check --locked -p victory-shader --tests --target x86_64-pc-windows-msvc` passed. No game files were used.
Bullet18x commented 2026-11-25 09:08:57 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by Bullet18x on 2026-11-25T08:24:09Z.


Tested on an RTX 5090, stacked with #69, #36, #35 and #33. standalone_interpolation_first_half_reads_the_vertices passes on the card.

In game, though, this pixel shader still fails the same way with the PR merged:

stage="pixel" hash=78f3f2fc53a69531 at 0x1464: the first half of an interpolation is not supported

38bf0814e721a1b3 fails at the same offset 0x1464 on main but wasn't reached in the shorter run. So the form this title uses at 0x1464 seems to be one the PR doesn't cover yet. I can send the shader or run a build with extra logging if that helps.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7156980592 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/68#issuecomment-7156980592). Originally posted by [Bullet18x](https://github.com/Bullet18x) on 2026-11-25T08:24:09Z. --- Tested on an RTX 5090, stacked with #69, #36, #35 and #33. `standalone_interpolation_first_half_reads_the_vertices` passes on the card. In game, though, this pixel shader still fails the same way with the PR merged: ``` stage="pixel" hash=78f3f2fc53a69531 at 0x1464: the first half of an interpolation is not supported ``` `38bf0814e721a1b3` fails at the same offset 0x1464 on `main` but wasn't reached in the shorter run. So the form this title uses at 0x1464 seems to be one the PR doesn't cover yet. I can send the shader or run a build with extra logging if that helps.
Artking175 commented 2026-11-25 09:08:58 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T08:59:39Z.


@Bullet18x Thanks for the precise shader hash and offset. The update in 7b623a2 keeps the first interpolation result when another instruction reads it or when the FP16 second half preserves part of the destination. It also uses the requested destination half. The packed FP16 case follows the failure analysis in victory-fork #203.

Could you retest 78f3f2fc53a69531 and, if available, 38bf0814e721a1b3 on this head? An offline translate --validate --pipelines --list run is enough. Please share whether each shader emits DXIL, validates, and creates a D3D12 pipeline, or its new refusal and offset.

The combined retest branch has both fixes and optional VICTORY_REFUSAL_CONTEXT=1 logging. If a shader still fails, the text from its shader refusal line would help. It includes the likely producer and consumer offsets without a shader dump.

Locally, 175 shader tests passed and 2 were ignored. Windows x64 Clippy passed. The exact title shaders are still awaiting retest on this head.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7157733329 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/68#issuecomment-7157733329). Originally posted by [Artking175](https://github.com/Artking175) on 2026-11-25T08:59:39Z. --- @Bullet18x Thanks for the precise shader hash and offset. The update in `7b623a2` keeps the first interpolation result when another instruction reads it or when the FP16 second half preserves part of the destination. It also uses the requested destination half. The packed FP16 case follows the failure analysis in [victory-fork #203](https://github.com/fxceless/victory-fork/pull/203). Could you retest `78f3f2fc53a69531` and, if available, `38bf0814e721a1b3` on this head? An offline `translate --validate --pipelines --list` run is enough. Please share whether each shader emits DXIL, validates, and creates a D3D12 pipeline, or its new refusal and offset. The [combined retest branch](https://github.com/Artking175/ztrx/tree/shader-refusal-retest) has both fixes and optional `VICTORY_REFUSAL_CONTEXT=1` logging. If a shader still fails, the text from its `shader refusal` line would help. It includes the likely producer and consumer offsets without a shader dump. Locally, 175 shader tests passed and 2 were ignored. Windows x64 Clippy passed. The exact title shaders are still awaiting retest on this head.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/68:upstream-pr/68'
git switch 'upstream-pr/68'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/68'
git switch 'upstream-pr/68'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/68'
git switch 'upstream-pr/68'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/68'
git switch 'main'
git merge --squash 'upstream-pr/68'
git switch 'main'
git merge --ff-only 'upstream-pr/68'
git switch 'main'
git merge 'upstream-pr/68'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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
Zettrox/ztrx!68
No description provided.