gfx10: preserve the separate volume filter in sampler words #959

Merged
leonida/mandy
Kadamitas merged 1 commit from fix/gfx10-sampler-z-filter into main 2026-11-29 15:46:16 +00:00

Pull request successfully merged and closed

Kadamitas commented 2026-11-24 15:43:39 +00:00

Claimed in the coordination issue as: Preserve the separate Z filter in GFX10 sampler descriptor words. This is a descriptive claim for an unlisted item. A formal ID was requested in the original finding.

What and why

A sampler with word2 = 0x01000000 loses its volume filter when decoded and re-encoded on a28927849. Z_FILTER occupies bits 25–24, between the XY filters and MIP_FILTER. Preserving those two bits lets the codec reproduce the sampler words supplied by the application. The change is confined to the descriptor representation and its CPU test. Independent reproduction

Tested

Built runtime/test/gfx10_descriptors_test.cpp with MinGW-w64 GCC 15.2, -std=c++20 -O2 and Vulkan headers on Windows x64. The test passed the point and linear encodings, all nine combinations of the defined Z and mip filter values, and the existing descriptor and 94-format checks. git diff --check and the repository game-data guard passed for both changed files.

GPUs tested: n/a. All changes and checks here concern CPU descriptor encoding.

AI-assisted: yes.

Claimed in the coordination issue as: [Preserve the separate Z filter in GFX10 sampler descriptor words](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136491390). This is a descriptive claim for an unlisted item. A formal ID was requested in [the original finding](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136312517). ### What and why A sampler with `word2 = 0x01000000` loses its volume filter when decoded and re-encoded on `a28927849`. `Z_FILTER` occupies bits 25–24, between the XY filters and `MIP_FILTER`. Preserving those two bits lets the codec reproduce the sampler words supplied by the application. The change is confined to the descriptor representation and its CPU test. [Independent reproduction](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136418737) ### Tested Built `runtime/test/gfx10_descriptors_test.cpp` with MinGW-w64 GCC 15.2, `-std=c++20 -O2` and Vulkan headers on Windows x64. The test passed the point and linear encodings, all nine combinations of the defined Z and mip filter values, and the existing descriptor and 94-format checks. `git diff --check` and the repository game-data guard passed for both changed files. GPUs tested: n/a. All changes and checks here concern CPU descriptor encoding. AI-assisted: yes.
KernelSmoker approved these changes 2026-11-24 15:45:45 +00:00
KernelSmoker left a comment

Verified on draft head fa90ff469dcd2d19c3af770068a7449d602c76cd with an independent Fedora 45 Linux build of runtime/test/gfx10_descriptors_test.cpp: GCC 16, C++20, -O2 -Wall -Wextra -Werror -Wno-missing-field-initializers -pedantic; the test passed, including the 94 format rows and the new point/linear plus Z/MIP cross-product round trips. check_no_game_data.py and git diff --check passed. Synthetic descriptor words only; no game data/GPU.

This verifies the stated codec round-trip fix. vulkan_sampler() still has no separate Z-filter mapping (Vulkan applies min/mag filtering across spatial axes), so this review does not claim changed runtime 3D texture filtering behavior.

Verified on draft head `fa90ff469dcd2d19c3af770068a7449d602c76cd` with an independent Fedora 45 Linux build of `runtime/test/gfx10_descriptors_test.cpp`: GCC 16, C++20, `-O2 -Wall -Wextra -Werror -Wno-missing-field-initializers -pedantic`; the test passed, including the 94 format rows and the new point/linear plus Z/MIP cross-product round trips. `check_no_game_data.py` and `git diff --check` passed. Synthetic descriptor words only; no game data/GPU. This verifies the stated codec round-trip fix. `vulkan_sampler()` still has no separate Z-filter mapping (Vulkan applies min/mag filtering across spatial axes), so this review does not claim changed runtime 3D texture filtering behavior.
sodove commented 2026-11-24 15:53:06 +00:00

Independent CPU check on Windows x64, MSVC 19.44.35220, comparing parent a28927849 and PR head fa90ff469. I ran the repository's gfx10_descriptors CTest on each revision and a separate raw-word round-trip probe compiled unchanged against each header.

The probe crossed all four XY magnification and minification values with the three defined volume-filter values and three mip-filter values (144 inputs). On the parent, 96 inputs lost their nonzero Z filter. All other bits stayed unchanged. On this head all 144 inputs round-tripped exactly, including the adjacent XY and mip fields. The repository CTest passed on both revisions. This checks descriptor encoding and decoding on the CPU.

Synthetic inputs only. AI-assisted: OpenAI Codex.

Independent CPU check on Windows x64, MSVC 19.44.35220, comparing parent `a28927849` and PR head `fa90ff469`. I ran the repository's `gfx10_descriptors` CTest on each revision and a separate raw-word round-trip probe compiled unchanged against each header. The probe crossed all four XY magnification and minification values with the three defined volume-filter values and three mip-filter values (144 inputs). On the parent, 96 inputs lost their nonzero Z filter. All other bits stayed unchanged. On this head all 144 inputs round-tripped exactly, including the adjacent XY and mip fields. The repository CTest passed on both revisions. This checks descriptor encoding and decoding on the CPU. Synthetic inputs only. AI-assisted: OpenAI Codex.
zmasi commented 2026-11-29 00:31:02 +00:00

#959 | head f7f766145b3e3549febbbeb000574772252f055e (merged cleanly with main 829530dbd0196aa817dbec74aaafc79407b94b57 — no conflicts on current main) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^(gfx10_descriptors|d3d12_sampler2|d3d12_descriptor)$" --output-on-failure (LEONIDA_VK_VALIDATION=1) | red proof: omitting field(std::uint32_t(sampler.volume_filter), 24, 2) in runtime/src/gfx10_descriptors.h fails gfx10_descriptors at line 341: (one_field({.volume_filter = VolumeFilter::point}) == SamplerWords{0, 0, 1u << 24, 0}) | green on PR+main: 3/3 CTests (gfx10_descriptors — T#, S# and V# fields, round trips, 95 format rows and the Vulkan mappings OK, d3d12_sampler2, d3d12_descriptor including volume SRVs: 0 of 256 sampled RGBA texels differ and volume minimum LOD: 256/256 samples matched) pass in 1.71 s on RTX 3090 with 0 Khronos validation errors; check_no_game_data.py 0 violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes

#959 | head f7f766145b3e3549febbbeb000574772252f055e (merged cleanly with main 829530dbd0196aa817dbec74aaafc79407b94b57 — no conflicts on current `main`) | `ctest --test-dir runtime/build -C RelWithDebInfo -R "^(gfx10_descriptors|d3d12_sampler2|d3d12_descriptor)$" --output-on-failure` (`LEONIDA_VK_VALIDATION=1`) | red proof: omitting `field(std::uint32_t(sampler.volume_filter), 24, 2)` in `runtime/src/gfx10_descriptors.h` fails `gfx10_descriptors` at `line 341: (one_field({.volume_filter = VolumeFilter::point}) == SamplerWords{0, 0, 1u << 24, 0})` | green on PR+main: `3/3` CTests (`gfx10_descriptors` — `T#, S# and V# fields, round trips, 95 format rows and the Vulkan mappings OK`, `d3d12_sampler2`, `d3d12_descriptor` including `volume SRVs: 0 of 256 sampled RGBA texels differ` and `volume minimum LOD: 256/256 samples matched`) pass in `1.71 s` on RTX 3090 with `0` Khronos validation errors; `check_no_game_data.py` `0` violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes
OreoFR commented 2026-11-29 01:17:43 +00:00

Verified by OreoFR

  • Base: main 48bae6cad + PR head f7f766145 (tested as a merge)
  • Test: ctest -R ^gfx10_descriptors$ (RelWithDebInfo, Ninja)
  • Red on main: the PR's test does not compile on main (VolumeFilter is not declared): the missing field is the change itself
  • Green with the PR: gfx10_descriptors passes
  • gta6rt link: OK (gta6rt.exe builds and links; dumpbin /dependents shows the same DLLs as main, no network DLL)
  • Verdict: READY (the PR also merges without conflict on the newer main 5825b02ff; it also merges cleanly together with #2089, same two files)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

**Verified by OreoFR** - Base: main `48bae6cad` + PR head `f7f766145` (tested as a merge) - Test: `ctest -R ^gfx10_descriptors$` (RelWithDebInfo, Ninja) - Red on main: the PR's test does not compile on main (`VolumeFilter` is not declared): the missing field is the change itself - Green with the PR: `gfx10_descriptors` passes - gta6rt link: OK (`gta6rt.exe` builds and links; `dumpbin /dependents` shows the same DLLs as main, no network DLL) - Verdict: READY (the PR also merges without conflict on the newer main `5825b02ff`; it also merges cleanly together with #2089, same two files) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
MoonEyes commented 2026-11-30 08:12:58 +00:00

Merged. Tested by @zmasi on head f7f766145 (RTX 3090, Windows 11): gfx10_descriptors CTest: red with volume_filter field omitted (line 341), green 3/3 CTests; OreoFR: test not compiling o. Correction: I had not shown that every failed or cancelled CI job on this head was also red on main. Not shown: macos-python (cancelled). My earlier sentence was too broad. Thanks @Kadamitas!

AI-assisted: yes

Merged. Tested by @zmasi on head f7f766145 (RTX 3090, Windows 11): gfx10_descriptors CTest: red with volume_filter field omitted (line 341), green 3/3 CTests; OreoFR: test not compiling o. Correction: I had not shown that every failed or cancelled CI job on this head was also red on main. Not shown: macos-python (cancelled). My earlier sentence was too broad. Thanks @Kadamitas! AI-assisted: yes
Sign in to join this conversation.
No description provided.