Repository navigation
Shaders: round D16 image reads according to the bound texture format - #2030
AlanQiang0418 wants to merge 4 commits into
Conversation
|
Triage verdict — Keep for #2006, tighten the test signal ( Evidence
Checks and limits
Next step
This verification was AI-assisted. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-shader --lib d16— 4 passed, 0 failed on RTX 5090 hardware + WARP (includingd16_image_load_rounds_normalized_texels_to_nearestandd16_image_sample_keeps_fractional_normalized_texels)cargo test -p victory-gpu --lib texture_rounding_follows_the_view_in_a_reused_heap_slot— 1 passed, 0 failed on RTX 5090cargo clippy -p victory-shader -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Awesome sideband view_table implementation solving #2006 cleanly across both victory-gpu and victory-shader, verified end-to-end on RTX 5090 + WARP. Looks good.
AI-assisted (Gemini 4 Neon).
|
A remaining D16 case on f6058b0: a static MIN_MAG_MIP_POINT sampler selects one texel. The exact normalized-code conversion currently applies to loads and gathers, so a point SampleLevel still takes the interpolated-sample conversion and can double-round. 79867f9 is one commit on that exact head. It uses the existing exact conversion for a statically known point sampler. The same WARP dispatch failed before with UNORM16 code 0xffaf returning 0x3bfe instead of 0x3bfd. After, both UNORM edge codes, the two signed SNORM edge codes and the linear interpolation control passed. The regression also requires a backend to dispatch. Full forced-WARP shader suite: 245 passed / 4 failed / 3 ignored before, 246 / 3 / 3 after. The gather, lane-permute and edge-flagged triangle failures were present in both runs. Strict shader Clippy and asset policy passed. |
|
On Linux the FLOAT path needs one more step. RTX 5080, driver 620.73.04, Wine 11.22, vkd3d-proton 3.1,
astrosteveo@980acd1 is one commit on your head: it uses the existing The |
|
Review of
The last row matters for the WARP results in #2006, where some returned f32 values were one ULP off: re-rounding Things I checked that hold:
Open points:
Model script (
|
|
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200 Environment: Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5060 Ti (driver 621.24,
The PR's D16 tests pass on this hardware (and on WARP):
The 5 failures are pre-existing on main (identical panics at
Nothing introduced by this PR fails on this machine. |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.
144 passed / 0 failed. D16 image reads round according to the bound texture format — format-aware rounding for D16 paths; mixed gpu+shader, gpu half Windows-only. Relates to #1927/#1940 d16 load cluster.
(cherry picked from commit 79867f9)
legacyF32ToF16 truncates on Windows but rounds to nearest under vkd3d-proton on an RTX 5080, where the FLOAT control of d16_image_load_rounds_normalized_texels_to_nearest failed on all 256 texels. f16_toward_zero gives the same result for either rounding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 980acd1)
|
Test report for Tested
Review points
AI-assisted (Claude Code); runs on the machine above. |
|
@upipibi I reproduced the immediate-sampler control-flow case on e87c4f1. A guest shader selects point or linear sampling by workgroup. On WARP the point arm returned 0x3bfe for UNORM16 code 0xffaf, where it should return 0x3bfd. 734f7d6 uses the existing sampler choice to select the D16 rounding path in one commit on that exact head. The regression passes with both arm orders. Point reads back 0x3bfd and linear reads back 0x37fe. Forcing the exact texel conversion on both arms changes the linear result to 0x37ff, which the test also catches. Heap-loaded samplers still take the f32 path because their filter is runtime data. Full forced-WARP shader suite: 246 passed, 4 failed and 3 ignored before, 247 passed, 3 failed and 3 ignored after. The gather, lane-permute and edge-flagged triangle failures were present in both builds. Strict shader Clippy and staged asset policy passed. |
|
I also verified the A4B4G4R4_UNORM point from the review. WARP reports texture-load support for this format. On e87c4f1, D16 image_load returned 0x38cc per channel for code 9. The nearest half for 9/15 is 0x38cd. 2a474f0 adds the format to the existing normalized tag and extends the native readback. All 16 codes now match across all four channels. The same test still covers the existing FLOAT, RGBA8 and RGBA16 cases. The two follow-ups apply together without a textual conflict. DXGI format reference Full forced-WARP shader suite: 245 passed, 4 failed, 3 ignored before and 246 passed, 3 failed, 3 ignored after. The three unrelated failures were shared. Strict shader Clippy and staged asset policy passed. |
|
@andrewpozdnakov7-jpg Thanks for chasing both points.
AI-assisted (Claude Code). Synthetic tests only. |
|
Automated triage for the maintainers. This pull request no longer merges cleanly into Generated by Claude Code |
|
The three review changes are together in 1d1f883, directly on e87c4f1. It includes the A4B4G4R4_UNORM and point/linear Phi changes from 2a474f0 and 734f7d6. sRGB formats keep the pre-PR toward-zero pack path pending console measurements. The new WARP check reads a real RGBA8 sRGB view across all 256 codes. With the original sRGB tag, code 1's green channel rounded to 0x3bee instead of 0x3bed from the same view on the truncating path. With this commit, all 256 sRGB texels match that control. All five D16 tests passed, including RGBA8 and RGBA16 UNORM/SNORM, all 16 packed codes, and point/linear sampler selection. Full forced-WARP shader suite with the same added fixture: 246 passed, 4 failed, 3 ignored before and 247 passed, 3 failed, 3 ignored after. The three remaining failures are the same existing gather, lane-permute and edge-flag tests. Strict Clippy and the staged policy check passed. For the evidence link in the PR description, the primary gfx1036 measurements cover 8- and 16-bit UNORM/SNORM loads and point samples, with 8-bit code 9 returning 0x2885. The xcl report shows the corresponding truncation difference. These measurements cover linear normalized texels. Please preserve the Git author if you cherry-pick the commit. If you fold the changes or tests into another commit, please add: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com AI-assisted. Synthetic tests only. |
Offline measurement on a retail dumpResult: no count change against I merged head e87c4f1 onto No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
|
I resolved the current-main conflicts on 190dd03. It keeps On WARP 1.0.22 with Agility 1.620.2, all seven D16 tests and all eight stride tests passed, including integer buffer round trips, UNORM/SNORM image loads, and immediate point/linear sampling. The 64-bit image atomic test also passed. The full shader run was 300 passed, 5 failed, 3 ignored. Four of those tests also failed in the full main control. The fifth, The separate runtime sampler-heap case still needs the point/linear choice to reach the shader. The existing fixture and measured If you take the integration, please retain the original Git authors, or add AI-assisted with Codex. |
Fixes #2006.
Validation
On RTX 5080 (621.14) and WARP, the translated shader matched all 256 codes of each RGBA8 UNORM/SNORM format and all 65,536 codes of each RGBA16 UNORM/SNORM format. The signed FLOAT controls and filtered RGBA16_UNORM sample also passed on both backends. All six
victory-gpu::drawtests passed on each backend, including the descriptor-slot reuse regression. Clippy passed for both crates with--all-targets --all-features -- -D warnings.The RTX gather failure and two shader stride-test failures also reproduce on upstream
940d32f. The tests here use synthetic textures.AI-assisted with OpenAI Codex.