gfx10: preserve the sampler volume filter #1127

Closed
bobcatchris wants to merge 1 commit from upstream-pr/1127 into main
bobcatchris commented 2026-11-24 18:58:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-24T18:58:15Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478429151 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1127). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-24T18:58:15Z. --- 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.
KernelSmoker commented 2026-11-24 19:13:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T19:13:51Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045702790 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1127#pullrequestreview-6045702790). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T19:13:51Z. **Review:** APPROVED --- 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.
abnalstlll-byte commented 2026-11-24 19:16:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:16:13Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045739068 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1127#pullrequestreview-6045739068). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:16:13Z. **Review:** APPROVED --- 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.
madhyn commented 2026-11-24 19:30:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by madhyn on 2026-11-24T19:30:04Z.


Tested fcb3e7e7f on Arch Linux + NVIDIA RTX 3060 Ti:

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

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142186848 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1127#issuecomment-7142186848). Originally posted by [madhyn](https://github.com/madhyn) on 2026-11-24T19:30:04Z. --- Tested `fcb3e7e7f` on Arch Linux + NVIDIA RTX 3060 Ti: - `gfx10_descriptors`: **Passed** (0.00 s) - `vk_sampler_test`: built cleanly AI-assisted: yes
bobcatchris commented 2026-11-24 19:45:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-24T19:45:17Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142542051 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1127#issuecomment-7142542051). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-24T19:45:17Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1127
No description provided.