Recompiler: image_sample_o under an implicit LOD moves each blended mip by its own texels #229
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!229
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/229/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@artor410 on GitHub · 2026-11-23 21:24 UTC · original
artor410:recomp/sample-offset-per-mip→main· +203 −38 · 3 files · 1 commits · merged 2026-11-23 21:31 UTCHANDOFF "Next steps" 5:
image_sample_owith an offset from a VGPR. A pixel shader's implicit LOD with a linear mip filter blends two mips; the console moves each one by the offset in its own texels. XCL moved both by offset / size of the rounded LOD's mip, so the second mip read one texel off whenever the offset was half its texel or less.Summary
emit.rs:texel_offset/sample_coord/moved_coords, shared with the existing offset path (no second copy of the GetDimensions / sign-extension code).runner.rs:ViewTextureuploads every mip level (data= the levels one after the other);draw_views=drawwith textures and samplers.drawnow goes throughdraw_on_multi.tests.rs:draw_console_views(SGPRs + textures) and the new test.Evidence
gpu_ps_image_sample_offset_implicit_lod_between_mips: a PS draw, 8² / 4² / 2² / 1² texture (level k texel x = 100·k + x), point min/mag, linear mip, clamp, uv = pixel centre · 2^0.25 / 8 (LOD 0.25), offset (+1, 0). Expected per pixel, from the console rule:0.75 · texel₈(⌊8u⌋+1) + 0.25 · (100 + texel₄(⌊4u⌋+1)).pixel (0,0) = 25.75, expected 26(mip 1 read texel 0 instead of 1)After: passes;
gpu_image_sample_offset(lz) still passes.Rebased on
d4f17ca(draw_gsfrom #199 anddraw_viewsshare onedraw_gs_views).cargo test --workspace --no-fail-fast: lib 606 passed, every other target green excepte2e::test_title_draws_with_a_root_signature_under_the_debug_layer, which fails the same way onmainhere: my checkout's path is over 260 characters and the test title's overlay file writes hitos error 3. Tested on an NVIDIA RTX 3070 Ti (driver 610.88, 32-lane waves); not run on AMD.Merge Danger
Door: two-way
Blast Radius: PS
image_sample*_owith an implicit LODOnly that form changes; every other sample keeps its HLSL. Its HLSL now has three samples instead of one (the fallback
Sampleis always emitted; DXC folds the select only for static samplers) – I could not count how many pack programs use it without the pack. Not covered / not verified:CalculateLevelOfDetailand the sampler'sMipLODBias: not checked that it adds the bias as the hardware does (the test uses bias 0)._l_owith a fractional LOD and_b_ooutside a PS still use the one-mip form.Overlap: none of the open PRs that touch
emit.rs(#128, #134, #138, #152, #174, #187, #199, #202, #214) change the MIMG sample code.AI-assisted (Claude Code), synthetic inputs only, no game data.
🤖 Generated with Claude Code
@ivall on GitHub · 2026-11-23 21:31 UTC · original
Merged (main
60565c4), your rebased head; main had merged the earlier head withdraw_views(vs, gs, ...), the runner now has yourdraw_gs_viewsform. Checked on an RX 9070 (RDNA4):cargo build --workspace && cargo test --workspace -- --test-threads=4- 611 unit tests passed, 0 failed; the retail game still reaches its first menu at 30 fps.