Skip to content

Read coordinates after bias in clamped texture samples - #1

Open
MichaelSmithAI wants to merge 7 commits into
LAKSHYA-cmd-tech:fix/image-sample-d-cl-and-gather4-lfrom
MichaelSmithAI:fix-clamped-sample-bias-coordinates
Open

MichaelSmithAI wants to merge 7 commits into
LAKSHYA-cmd-tech:fix/image-sample-d-cl-and-gather4-lfrom
MichaelSmithAI:fix-clamped-sample-bias-coordinates

Conversation

@MichaelSmithAI

@MichaelSmithAI MichaelSmithAI commented Nov 24, 2026 •

Copy link
Copy Markdown

On the branch for Marvisak#694, image_sample_b_cl reads the bias again as the first texture coordinate. For a 2D sample with UV (0.5, 0.75), bias 0.25 and minimum LOD 2, the emitted call samples at (0.25, 0.5) with minimum LOD 0.75. Both biased forms use DXIL opcode 61, so this change advances past the bias for both.

The regression builds an original pixel shader that exports the sample and checks the four arguments on its emitted dx.op.sampleBias.f32 call. The expected operands match DXC's output for the equivalent HLSL. The test fails on c169328. With the change, all 58 Linux shader library tests pass (cargo +stable test --locked --offline -p victory-shader --lib) and the repository asset check passes.

On an RTX 4090 under Wine and vkd3d-proton we rendered the same synthetic texture with the parent shader, the corrected shader, and an independent HLSL reference compiled by DXC. The texture encodes its mip and coordinates in the sampled red value. All 64 pixels from the parent returned 142 (mip 1, x=2, y=4). All 64 from the corrected shader and all 64 from the reference returned 232 (mip 2, x=2, y=3). The effect on GTA VI remains unmeasured. AI-assisted implementation and review.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c68149db-6598-4335-8c1e-ac3ff6ca6c54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@LAKSHYA-cmd-tech
LAKSHYA-cmd-tech force-pushed the fix/image-sample-d-cl-and-gather4-l branch from c169328 to 88f55ef Compare November 24, 2026 08:01
@LAKSHYA-cmd-tech
LAKSHYA-cmd-tech force-pushed the fix/image-sample-d-cl-and-gather4-l branch from 88f55ef to 0beec4d Compare November 24, 2026 08:36
@LAKSHYA-cmd-tech
LAKSHYA-cmd-tech force-pushed the fix/image-sample-d-cl-and-gather4-l branch from 0beec4d to efd02d5 Compare November 24, 2026 16:51
LAKSHYA-cmd-tech pushed a commit that referenced this pull request Nov 25, 2026
Exercise the descriptor cursor regression on the actual heap capacity
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.

3 participants