Repository navigation
Conversation
The HLSL path's image_sample_o in a pixel shader with an implicit LOD and a linear mip filter samples the two blended mips with SampleLevel, each moved by the offset in its own texels, and blends them by the LOD's fraction (20271d4). The direct translator still moved the coordinates once, by the offset over the size of the rounded LOD's mip, so the second mip read a texel off when the offset was half its texel or less. Port that form: LOD = the clamped implicit LOD (raised by the _cl clamp, capped at the view's last mip), mips floor(LOD) and the next one (capped too), each with its own texel offset, lerp by the fraction. It is taken under the same conditions read from the S#: MIP_FILTER linear, not anisotropic, and LOD >= 1 or min = mag filter; otherwise the single Sample as before. The texel-offset computation moves into a helper shared with the existing path. TRANSLATOR_VERSION 7 -> 8: the emitted containers change for these programs. Open PR xcl-dev#1793 also bumps TRANSLATOR_VERSION. Identical edits merge silently in git, so check the bump by hand at merge time: the later change takes the next free number, or the pipeline cache could serve containers of another translator under the same version. The existing test gpu_ps_image_sample_offset_implicit_lod_between_mips now also draws its pixel shader through the direct translator and expects the same result.
Contributor
|
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, AI-assisted (Claude Code). Synthetic tests only. |
Contributor
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For
image_sample_oin a pixel shader with an implicit LOD and a linear mip filter, the HLSL path samples both blended mips, each offset by its own texels. The direct translator offset the coordinates once, by the rounded LOD's mip size, so the other mip could read a texel off. This ports the HLSL form.TRANSLATOR_VERSIONgoes from 7 to 8. #1793 and other changes to the direct translator also set 8; identical edits merge silently, so whichever lands later should take the next free number.Draft: the head commit has not been built or tested yet.
What is in it
gpu/dxil/lower_image.rs: the two-mip form, and a texel-offset helper shared with the existing pathgpu/dxil/kernel.rs:TRANSLATOR_VERSION8gpu/recomp/tests.rs:gpu_ps_image_sample_offset_implicit_lod_between_mipsnow also draws through the direct translatorTested
These runs are from before the final rebase, on a combined branch (
376f968, based on main689f2db; it holds this change, both halves of the differential mode and five other direct-translator parity fixes; this change's code is the same there), not on this PR's head commit.cargo testdebug build. Driver, CPU and Rust versions were not recorded.cargo test -p xcl --lib gpu_ps_image_sample_offset_implicit_lod_between_mips -- --nocapture --test-threads=1: passed.Regression run
Not run: there are no
xcl-smokeblocks for this change.Not tested
f5136a6) has not been built or tested: it was rebased on macOS, with no Rust toolchain.cargo test --workspacewas not run for this change on its own.lower_image.rs(MSAA loads) since the tested base; it merged without conflict.tests.rs; whichever lands second should keep Tests: implicit-LOD sample offset test uses s_wqm and the host's LOD #982's weights and check both backends against them.AI use