gfx10: preserve the sampler volume filter #1127

Closed
github-bot wants to merge 1 commit from gh-pr/1127/head into gh-pr/1127/base
Owner

@⁠bobcatchris on GitHub · 2026-11-24 18:58 UTC · original
bobcatchris:fix/gfx10-sampler-z-filter → main · +26 −3 · 2 files · 1 commits · closed without merging

Claimed in the coordination issue as: D3D-GFX10-SAMPLER-Z-FILTER

Depends on: none

Fixes: none

What and why

The GFX10 sampler codec omitted WORD2 Z_FILTER [25:24]. decode() therefore lost the volume filter and encode() wrote it back as zero, changing point/linear/anisotropic volume sampling on any descriptor round trip. The field is now stored independently from XY and mip filtering, with all four encodings covered. Original finding by @⁠Kadamitas.

Tested

  • Baseline raw-word probe: fails with Z_FILTER 1 dropped.
  • Patched gfx10_descriptors_test: passes all T#/S#/V# fields, 94 format rows, round trips and Vulkan mappings.
  • ctest -R "^(replay_clear_gate|gfx10_descriptors)$": 2/2 passed.
  • scripts/check_no_game_data.py: clean.
  • Patch security sweep: 0 hits.

GPUs tested: n/a (CPU-only descriptor codec test)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • N/A — not a translator rule.
**@⁠bobcatchris** on GitHub · 2026-11-24 18:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1127) `bobcatchris:fix/gfx10-sampler-z-filter` → `main` · +26 −3 · 2 files · 1 commits · closed without merging Claimed in the coordination issue as: D3D-GFX10-SAMPLER-Z-FILTER Depends on: none Fixes: none ### What and why The GFX10 sampler codec omitted WORD2 `Z_FILTER` [25:24]. `decode()` therefore lost the volume filter and `encode()` wrote it back as zero, changing point/linear/anisotropic volume sampling on any descriptor round trip. The field is now stored independently from XY and mip filtering, with all four encodings covered. Original finding by @⁠Kadamitas. ### Tested - Baseline raw-word probe: fails with `Z_FILTER 1 dropped`. - Patched `gfx10_descriptors_test`: passes all T#/S#/V# fields, 94 format rows, round trips and Vulkan mappings. - `ctest -R "^(replay_clear_gate|gfx10_descriptors)$"`: 2/2 passed. - `scripts/check_no_game_data.py`: clean. - Patch security sweep: 0 hits. GPUs tested: n/a (CPU-only descriptor codec test) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [x] N/A — not a translator rule.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:39:27 +00:00
github-bot closed this pull request 2026-11-26 09:39:27 +00:00
Author
Owner

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

Reviewed exact head fcb3e7e7f5. Built gfx10_descriptors_test from the PR tree in the project's Vulkan tools container; CTest gfx10_descriptors passed (1/1). The added Z_FILTER field is encoded/decoded at WORD2[25:24], with tests for all four enum values and raw-word round trips. I also checked the runtime callers: Vulkan sampler creation continues to use XY mag/min and mip fields, while this patch preserves the GFX10 descriptor's volume-filter bits for descriptor readback. This validates the CPU codec only; I did not run D3D12/GPU integration on Linux.

**@⁠KernelSmoker** on GitHub · 2026-11-24 19:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1127#pullrequestreview-6045702790) · **approved these changes** Reviewed exact head fcb3e7e7f52b9fa2467e394e7327becc4945230b. Built gfx10_descriptors_test from the PR tree in the project's Vulkan tools container; CTest gfx10_descriptors passed (1/1). The added Z_FILTER field is encoded/decoded at WORD2[25:24], with tests for all four enum values and raw-word round trips. I also checked the runtime callers: Vulkan sampler creation continues to use XY mag/min and mip fields, while this patch preserves the GFX10 descriptor's volume-filter bits for descriptor readback. This validates the CPU codec only; I did not run D3D12/GPU integration on Linux.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:16 UTC · original · approved these changes

Reviewed and verified. Preserves GFX10 sampler Z_FILTER bits (WORD2[25:24]) in descriptor encode/decode codec, preventing corruption of 3D volume sampler filtering on descriptor round trips. Verified with gfx10_descriptors_test across all 4 enum values. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1127#pullrequestreview-6045739068) · **approved these changes** Reviewed and verified. Preserves GFX10 sampler `Z_FILTER` bits (WORD2[25:24]) in descriptor encode/decode codec, preventing corruption of 3D volume sampler filtering on descriptor round trips. Verified with `gfx10_descriptors_test` across all 4 enum values. 100% clean-room.
Author
Owner

@⁠madhyn on GitHub · 2026-11-24 19:30 UTC · original

Tested fcb3e7e7f on Arch Linux + NVIDIA RTX 3060 Ti:

  • gfx10_descriptors: Passed (0.00 s)
  • vk_sampler_test: built cleanly

AI-assisted: yes

**@⁠madhyn** on GitHub · 2026-11-24 19:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1127#issuecomment-7142186848) Tested `fcb3e7e7f` on Arch Linux + NVIDIA RTX 3060 Ti: - `gfx10_descriptors`: **Passed** (0.00 s) - `vk_sampler_test`: built cleanly AI-assisted: yes
Author
Owner

@⁠bobcatchris on GitHub · 2026-11-24 19:45 UTC · original

Closing after an impact audit: the codec round trip is fixed, but no runtime path decodes an S# and then re-encodes it. bind_sampler() decodes directly to VkSamplerCreateInfo, and Vulkan has no independent Z-axis filter, so preserving the field does not change any current rendering behavior. This is a valid codec invariant but not high-value enough for the contribution bar. No game data was used.

**@⁠bobcatchris** on GitHub · 2026-11-24 19:45 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1127#issuecomment-7142542051) Closing after an impact audit: the codec round trip is fixed, but no runtime path decodes an S# and then re-encodes it. `bind_sampler()` decodes directly to VkSamplerCreateInfo, and Vulkan has no independent Z-axis filter, so preserving the field does not change any current rendering behavior. This is a valid codec invariant but not high-value enough for the contribution bar. No game data was used.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.