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

Open
github-bot wants to merge 1 commit from github-bot/gh-959 into main AGit
Owner

@⁠Kadamitas on GitHub · 2026-11-24 15:43 UTC · original
Kadamitas:fix/gfx10-sampler-z-filter → main · +20 −3 · 2 files · 1 commits · open

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.

**@⁠Kadamitas** on GitHub · 2026-11-24 15:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/959) `Kadamitas:fix/gfx10-sampler-z-filter` → `main` · +20 −3 · 2 files · 1 commits · open Claimed in the coordination issue as: [Preserve the separate Z filter in GFX10 sampler descriptor words](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14). This is a descriptive claim for an unlisted item. A formal ID was requested in [the original finding](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14). ### 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://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:30:29 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-24 15:45 UTC · original · approved these changes

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.

**@⁠KernelSmoker** on GitHub · 2026-11-24 15:45 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/959#pullrequestreview-6042534727) · **approved these changes** 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.
Author
Owner

@⁠sodove on GitHub · 2026-11-24 15:53 UTC · original

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.

**@⁠sodove** on GitHub · 2026-11-24 15:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/959#issuecomment-7136773298) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/959/head:github-bot/gh-959'
git switch 'github-bot/gh-959'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-959'
git switch 'github-bot/gh-959'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-959'
git switch 'github-bot/gh-959'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-959'
git switch 'main'
git merge --squash 'github-bot/gh-959'
git switch 'main'
git merge --ff-only 'github-bot/gh-959'
git switch 'main'
git merge 'github-bot/gh-959'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.