Repository navigation
Conversation
|
I reproduced a magnification edge case on native Windows 11 with an RTX 5070 (driver 32.0.16.1088) and DXC 1.9.2609.5. I applied I duplicated
Using Synthetic textures only. Rust 1.100.0, clang-cl/lld 19.1.1 with xwin SDK 10.0.26100. AI-assisted (Codex). |
ivall#229 picks the offset's mip for the plain form only; the bias, gradient and (in a PS) comparison forms still divided by mip 0's size. The level is now the given LOD, else that of the given gradients or the pixel's own (screen derivatives for comparison samplers, which CalculateLevelOfDetail does not take), plus the bias. That LOD is the unclamped one, so a bias on a magnified pixel starts below 0 (found by ryotdev); the sampler's MIN_LOD / MAX_LOD and the view's last mip are applied after the bias. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
fd45f20 to
a60db9f
Compare
|
Thanks @ryotdev, that was a real regression. Your case is now The new head 🤖 Claude Opus 5.5 |
|
Tested #247
|
|
Tested
The magnification case from the comment above ( Not checked: the negative control, or any game. AI-assisted (Claude Code). |
|
Tested on RTX 5060 Ti 8 GB, driver 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native), Rust 1.100.0 msvc, debug. Run and written with Claude Code (Claude Opus 5.5). |
|
Regression run wanted. We have no title on our machine. If you can run 🤖 Claude Opus 5.5 |
|
Tested PR #247 head Tested
Findings (synthetic probes reproduced identically on both RTX 4090 and AMD RDNA2)
Not tested
AI useAntigravity (Gemini frontier model) assisted with code review, dual-GPU synthetic probe execution, and drafting this report; every line cited and repro result was directly verified on this host. |
|
Tested Tested
Not tested
AI use
|
|
@Kalmarv the regression run you asked for, plus the first RDNA3 run. Tested
Regression run (retail title,
this PR's head Not tested
AI use
|
|
Re-tested Pass: 675 passed, 0 failed, 41 ignored. SKIPPED: only the 2 Run and written with Claude Code (Claude Opus 5.5). |
|
@srcamarda thank you, both blocks are in the description under Regression run, with your three-run spread and the note that the title's first menus don't reach an 🤖 Claude Opus 5.5 |
Follows #229. #229 moves the coordinates by offset / size of the mip the console reads, but it picks that mip only for the plain form (implicit LOD in a PS, or a given LOD). The bias, gradient and comparison forms still take mip 0's size. With a point mip filter, the texel read is then off by up to one texel of the mip actually sampled. This PR picks the mip for those forms too.
What main does today:
image_sample_b_o: in a PS, the implicit LOD without the bias; outside a PS, mip 0, though the sample isSampleLevel(bias).image_sample_d_o/cd_o: mip 0 whatever the gradients say.image_sample_c_oin a PS: mip 0, because the plain-form branch excludes comparison samplers.CalculateLevelOfDetailtakes noSamplerComparisonState; DXC rejects it.What is in it
One commit,
a60db9f, onmain9ab7d76:crates/xcl/src/gpu/recomp/emit.rs: the offset's level for these forms is:log2of the longer gradient in mip-0 texels), or in a PS the pixel's own LOD (CalculateLevelOfDetailUnclamped, or for comparison samplers the samelog2ofddx/ddyof the coordinates);The LOD is unclamped before the bias, so a bias on a magnified pixel starts below 0. @ryotdev found that the first head (
fd45f20) got this wrong. The plain form, lz, gather and given-LOD forms take the same path as before.crates/xcl/src/gpu/recomp/tests.rs: five new GPU tests on a 2-mip texture (8², 4²) with point min, mag and mip filters, so each pixel reads exactly one mip.Tested
cargo test --workspace -- --test-threads=4ona60db9f: 656 passed, 0 failed, 40 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, both "no wave64").mainwith and without theemit.rschange (the same test code in both):gpu_ps_image_sample_offset_point_mip(control, plainsample_o)gpu_ps_image_sample_offset_bias_lod(b_o, LOD 0 + bias 1)gpu_ps_image_sample_offset_bias_lod_magnified(b_o, LOD -1 + bias 1, @ryotdev's case)fd45f20: FAIL, (0,0) = 2, expected 1)gpu_ps_image_sample_offset_gradient_lod(d_oandcd_o, gradient LOD 1)cd_ofails the same way, 48 of 256 pixels)gpu_ps_image_sample_offset_compare_lod(c_o, implicit LOD 1, LESS_EQUAL)gpu_ps_image_sample_offset_implicit_lod_between_mips(#229's)gpu::recomp::ona60db9f: 187 passed, 0 failed, 18 ignored.fd45f20, before the magnification fix, onmain9ab7d76with an RX 6600 XT (RDNA2).cargo test --workspace: main 651 passed, 0 failed; PR 655 passed, 0 failed. No GPU test was skipped, and the four new tests of that head passed.a60db9f:cargo test --workspace, 656 passed, 0 failed, 40 ignored, and the 5 new tests pass (Recompiler: image_sample_b/d/cd/c_o offsets move by the mip they read #247 (comment)).a60db9f:cargo test --workspace, 656 passed, 0 failed, 40 ignored (Recompiler: image_sample_b/d/cd/c_o offsets move by the mip they read #247 (comment)).a60db9fmerged ontomain2b4bb43, on an RTX 5060 Ti, debug, with the debug-layer tests enabled:cargo test --workspace, 675 passed, 0 failed, 41 ignored; the only SKIPPED tests are the two "no wave64" ones (Recompiler: image_sample_b/d/cd/c_o offsets move by the mip they read #247 (comment)).a60db9fmerged ontomain4017f8f(a clean merge) (Recompiler: image_sample_b/d/cd/c_o offsets move by the mip they read #247 (comment)):scripts/test.ps1: 657 passed, 0 failed, 40 ignored, with no SKIPPED GPU tests.tests.rs(noemit.rschange),…_bias_lod,…_gradient_lodand…_compare_lodfail;…_point_mipand…_bias_lod_magnifiedpass with and without the fix.Regression run
Run by @srcamarda on a retail title (RX 7800 XT, RDNA3; release; 90 s; #247 (comment)). Three runs of each, the first with a cold translation cache:
main901 / 1180 / 1184 frames, this PR 1168 / 1167 / 1357; no crash or device removal in any. Thegpu:line names a virtual display adapter; XCL ran on the RX 7800 XT. No_osample form appears in the title's first menus, so this is a regression check, not a test of the change. The second run of each, as posted:main:
PR:
Not tested
image_sample_d/cd/c*_o(main used level 0 there). Onimage_sample_l_othe offset uses the given LOD before the sampler's bias and MIN/MAX_LOD, as on main. Sampler bias onimage_sample_b_ofollows it on NVIDIA 610.74 (measured); AMD not measured.gpu_ps_image_sample_offset_bias_lod_magnifiedand for the heada60db9f: the RX 6600 XT run above is offd45f20. RDNA4 rana60db9f(@nullmarsh, above).b_oandd_ooutside a pixel shader, 1D / 3D / array textures, A16 addresses, and a min-LOD clamp (_cl_) together with an offset.log2of the longer gradient, which can differ from the hardware's at a mip boundary. The plain form'sCalculateLevelOfDetailhas the same limit.AI use