Skip to content

Exercise signed texture sample offsets on both pixel-shader axes - #1

Open
MichaelSmithAI wants to merge 2 commits into
SAitken91:shader/image-sample-ofrom
MichaelSmithAI:test/pixel-sample-offset
Open

MichaelSmithAI wants to merge 2 commits into
SAitken91:shader/image-sample-ofrom
MichaelSmithAI:test/pixel-sample-offset

Conversation

@MichaelSmithAI

@MichaelSmithAI MichaelSmithAI commented Nov 24, 2026 •

Copy link
Copy Markdown

This test exercises the pixel shader path added in upstream PR #634. The author measured four additional GTA VI pixel programs passing shader validation on that change, including one used in volumetric lighting reconstruction.

An original 2D shader samples a texture and exports its color. It compiles with immediate offsets (−8, +7) and (+7, −8). Each axis separately rejects +8 and −9 with the range-specific diagnostic. The fixture follows the shader through decoding, resource tracking, control-flow analysis and DXIL emission.

On the parent revision the first valid case fails at offset 60 with the unsupported instruction. On 260611a all 57 Linux shader library tests passed with this regression. To run it alone:

cargo test --locked -p victory-shader --lib image_sample_o_checks_signed_offsets_on_both_texture_axes

This change adds only the regression. The retail validation numbers come from the original PR. AI assistance was used to develop and verify the synthetic fixture.

Native pixel readback. The Windows differential harness has a case that draws the same shader through VIctory and the native PC compiler. A 33×33 one-mip point-sampled texture encodes each texel's coordinates. At the center of the draw, the three samples must return 767, 287 and 544 for (−8, +7), (+7, −8) and (0, 0). Both paths must independently match those values.

With the existing console and PC compilers configured and an SM 6.6 device, run from PowerShell:

$env:VICTORY_DIFF_ONLY = 'signed sample offsets'
cargo test --locked -p victory-shader translated_shaders_draw_as_pc_ones -- --nocapture

Look for the signed sample offsets: worst relative difference line and a passing test. The harness reports a skip if the compilers or device are unavailable. The Windows test target was type-checked from Linux. The SDK-dependent differential case above still awaits execution.

A separate D3D12 run used the original shader words at 9c7b8e0 and a PC vertex shader to draw on an RTX 4090 through Wine 11.22 and vkd3d-proton 3.1. All 256 pixels returned texel 767 at (−8, +7), 287 at (+7, −8), and 544 at (0, 0). An independently compiled PC pixel shader produced the same three values. Microsoft DXIL validation passed for the three translator outputs. The run used a synthetic texture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant