gfx10: preserve the sampler volume filter #1127

Closed
leonida/mandy
bobcatchris wants to merge 0 commits from fix/gfx10-sampler-z-filter into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

bobcatchris commented 2026-11-24 18:58:15 +00:00

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.
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 approved these changes 2026-11-24 19:13:51 +00:00
KernelSmoker left a comment

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.

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 approved these changes 2026-11-24 19:16:13 +00:00
abnalstlll-byte left a comment

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.

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

Tested fcb3e7e7f on Arch Linux + NVIDIA RTX 3060 Ti:

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

AI-assisted: yes

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

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.

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.
Sign in to join this conversation.
No description provided.