gfx10: anisotropy only for aniso filters, held to maxSamplerAnisotropy (RT-STATE-SAMPLER-ANISO) #2475

Closed
Tyrannys wants to merge 1 commit from upstream-pr/2475 into main
Tyrannys commented 2026-11-27 15:56:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-27T15:56:35Z.


Claimed in the coordination issue as: RT-STATE-SAMPLER-ANISO (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7222234085). This is item 2 of @kevincommits' RT-STATE-AUDIT-PIPELINE finding in #1608 (#2464 Part B).

Depends on: none. #2089 changes the mipLodBias line right above the lines changed here in vulkan_sampler(), and adds tests next to the ones added here. Whichever lands second may need a small textual rebase; the two changes share no logic.

What and why

Two sampler anisotropy gaps:

  1. vulkan_sampler() (runtime/src/gfx10_descriptors.h) set anisotropyEnable whenever MAX_ANISO_RATIO decoded above 1. That included an S# whose XY_MAG_FILTER and XY_MIN_FILTER are point or bilinear. On GFX10 only the ANISO_POINT and ANISO_BILINEAR filters use the ratio (radv picks the aniso filters when it wants anisotropy). So a raw or heap S# with a plain bilinear filter and a ratio set was filtered anisotropically on the host, but not on the console. Anisotropy is now on only when the mag or the min filter is an aniso filter, and maxAnisotropy is 1 otherwise. D3D12 *_ANISOTROPIC samplers already encode the aniso filters (d3d12_vulkan_device.cpp, filter() in the sampler encoder), so they are unchanged.
  2. bind_sampler() turned anisotropy off when the device lacks samplerAnisotropy, but it never held maxAnisotropy to limits.maxSamplerAnisotropy (VUID-VkSamplerCreateInfo-anisotropyEnable-01071). The LOD bias is already held to maxSamplerLodBias. vulkan_sampler() now takes the anisotropy limit next to the LOD-bias limit (default 16, the GFX10 maximum), and the device passes limits.maxSamplerAnisotropy, read where maxSamplerLodBias is read.

Tested

gfx10_descriptors_test gains these checks:

  • A bilinear/bilinear S# with ratio 16 gives anisotropyEnable == VK_FALSE, maxAnisotropy == 1. The same holds for point/point with ratio 4, and for words decoded the way bind_sampler does (XY_MAG/MIN_FILTER bilinear, MAX_ANISO_RATIO 4).
  • A bilinear mag filter with an aniso_bilinear min filter at 8x keeps anisotropy at 8.
  • A 16x aniso_bilinear sampler with a 4x device limit gives 4. A 2x aniso_point sampler with a 16x limit stays 2.

On main (ec91d695c), with the new header reverted and the two limit-argument checks dropped (that argument does not exist there), the test fails at the first new check (line 398: info.anisotropyEnable == VK_FALSE && info.maxAnisotropy == 1.0f). With the change it passes.

ctest -R "sampler|gfx10|descriptor|ssharp|aniso": 13/14 pass. The failure is d3d12_set_descriptor_heaps (recorded_commands), which also fails on main unchanged. Full suite (ctest -C Release -j 4): 497/501. Two of the failures, xbox_present and d3d12_set_descriptor_heaps, also fail on main. The other two, submit_mutex and d3d12_compile_pool, failed under load and pass when run alone.

No game files.

GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5529507914 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475). Originally posted by [Tyrannys](https://github.com/Tyrannys) on 2026-11-27T15:56:35Z. --- Claimed in the coordination issue as: RT-STATE-SAMPLER-ANISO (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7222234085). This is item 2 of @kevincommits' RT-STATE-AUDIT-PIPELINE finding in #1608 (#2464 Part B). Depends on: none. #2089 changes the `mipLodBias` line right above the lines changed here in `vulkan_sampler()`, and adds tests next to the ones added here. Whichever lands second may need a small textual rebase; the two changes share no logic. ### What and why Two sampler anisotropy gaps: 1. `vulkan_sampler()` (`runtime/src/gfx10_descriptors.h`) set `anisotropyEnable` whenever `MAX_ANISO_RATIO` decoded above 1. That included an S# whose `XY_MAG_FILTER` and `XY_MIN_FILTER` are `point` or `bilinear`. On GFX10 only the `ANISO_POINT` and `ANISO_BILINEAR` filters use the ratio (radv picks the aniso filters when it wants anisotropy). So a raw or heap S# with a plain bilinear filter and a ratio set was filtered anisotropically on the host, but not on the console. Anisotropy is now on only when the mag or the min filter is an aniso filter, and `maxAnisotropy` is 1 otherwise. D3D12 `*_ANISOTROPIC` samplers already encode the aniso filters (`d3d12_vulkan_device.cpp`, `filter()` in the sampler encoder), so they are unchanged. 2. `bind_sampler()` turned anisotropy off when the device lacks `samplerAnisotropy`, but it never held `maxAnisotropy` to `limits.maxSamplerAnisotropy` (VUID-VkSamplerCreateInfo-anisotropyEnable-01071). The LOD bias is already held to `maxSamplerLodBias`. `vulkan_sampler()` now takes the anisotropy limit next to the LOD-bias limit (default 16, the GFX10 maximum), and the device passes `limits.maxSamplerAnisotropy`, read where `maxSamplerLodBias` is read. ### Tested `gfx10_descriptors_test` gains these checks: - A bilinear/bilinear S# with ratio 16 gives `anisotropyEnable == VK_FALSE`, `maxAnisotropy == 1`. The same holds for point/point with ratio 4, and for words decoded the way `bind_sampler` does (`XY_MAG/MIN_FILTER` bilinear, `MAX_ANISO_RATIO` 4). - A bilinear mag filter with an `aniso_bilinear` min filter at 8x keeps anisotropy at 8. - A 16x `aniso_bilinear` sampler with a 4x device limit gives 4. A 2x `aniso_point` sampler with a 16x limit stays 2. On main (`ec91d695c`), with the new header reverted and the two limit-argument checks dropped (that argument does not exist there), the test fails at the first new check (`line 398: info.anisotropyEnable == VK_FALSE && info.maxAnisotropy == 1.0f`). With the change it passes. `ctest -R "sampler|gfx10|descriptor|ssharp|aniso"`: 13/14 pass. The failure is `d3d12_set_descriptor_heaps` (`recorded_commands`), which also fails on main unchanged. Full suite (`ctest -C Release -j 4`): 497/501. Two of the failures, `xbox_present` and `d3d12_set_descriptor_heaps`, also fail on main. The other two, `submit_mutex` and `d3d12_compile_pool`, failed under load and pass when run alone. No game files. GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
djrolfes commented 2026-11-27 17:36:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-27T17:36:21Z.


Independent Linux review/test at 2c56db700 (merged cleanly on origin/main c0201a806). AI-assisted.

  • Diff looks clean: vulkan_sampler enables anisotropy only for aniso_point / aniso_bilinear filters and clamps maxAnisotropy to limits.maxSamplerAnisotropy (propagated from DeviceState::max_sampler_anisotropy).
  • gfx10_descriptors (native Linux build): PASSED.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7224590570 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2475#issuecomment-7224590570). Originally posted by [djrolfes](https://github.com/djrolfes) on 2026-11-27T17:36:21Z. --- Independent Linux review/test at `2c56db700` (merged cleanly on `origin/main` `c0201a806`). AI-assisted. - Diff looks clean: `vulkan_sampler` enables anisotropy only for `aniso_point` / `aniso_bilinear` filters and clamps `maxAnisotropy` to `limits.maxSamplerAnisotropy` (propagated from `DeviceState::max_sampler_anisotropy`). - `gfx10_descriptors` (native Linux build): **PASSED**.
MoonEyes commented 2026-11-27 18:40:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T18:40:47Z.


Tested for #2464 as Aslanek asked: unit tests and a game run on my machine; CI ignored for now as asked.

RUN pr2475-court | 2026-11-27 | MoonEyes | AI-assisted: Claude Code (Claude Opus 5.5)
BASE:        main ec91d695c + PR #2475 (head 2c56db700), merged locally without conflict, nothing pushed | shaders: main's own translation
MACHINE:     RTX 4060 8 GB, desktop, only GPU, display attached | NVIDIA 610.88 | Windows 11 Pro 26300 | Ryzen 5 3600 | 32 GB | Windows GPU timeout at the default (2 s)
RECIPE:      short recipe: docs/running.md Windows NVIDIA recipe, pipeline cache warm, 330 s cap, scripted button presses from 60 s | build RelWithDebInfo, only the PR's targets built
TESTS:
  - gfx10_descriptors_test (ctest gfx10_descriptors): pass on the PR | fails on main: does not compile on main (the PR's test calls the sampler mapping with a third argument that main's function does not take)
GAME:        session=1 at 130 s | world entered at 185 s | last window >= 1 img/s ends at 267 s | 0 frames after world entry + 240 s | end: time limit (cap 330 s, ended at 334 s) | device loss: no (no fault report) | private RAM max 17032 MB
COMPARED TO: w77 (main ec91d695c, same short recipe): session=1 at 145 s, world at 195 s, last window >= 1 img/s at 293 s, private RAM max 16043 MB, ended by the time limit (337 s)
             w79 (main, same short recipe): world at 200 s, last window >= 1 img/s at 286 s, private RAM max 16583 MB, ended by the time limit (350 s)
             one run each (n=1); on main the spread of world entry on this recipe is about 165 to 200 s, so no conclusion on timings
VERDICT:     unit test passes and does not compile on main (new API); game run clean to the time limit, no device loss; no timing conclusion (n=1)

Reading (marked):

  • MEASURED: the display stops after the world is entered (82 s after world entry for the last window >= 1 img/s here; 98 s on w77, 86 s on w79). Present on main too, not caused by this PR (finding https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7224692645).
  • MEASURED: the run reached the time limit without a device loss; this says the PR does not break the game boot on this machine, not that it changes anything in the game.
  • The game logs of this run were deleted by a disk cleanup before this write-up; the figures above were extracted before that and cannot be re-checked from the logs now.

Limits: one machine, one run for the PR, one run for each main witness.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7225749333 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2475#issuecomment-7225749333). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T18:40:47Z. --- Tested for #2464 as Aslanek asked: unit tests and a game run on my machine; CI ignored for now as asked. ``` RUN pr2475-court | 2026-11-27 | MoonEyes | AI-assisted: Claude Code (Claude Opus 5.5) BASE: main ec91d695c + PR #2475 (head 2c56db700), merged locally without conflict, nothing pushed | shaders: main's own translation MACHINE: RTX 4060 8 GB, desktop, only GPU, display attached | NVIDIA 610.88 | Windows 11 Pro 26300 | Ryzen 5 3600 | 32 GB | Windows GPU timeout at the default (2 s) RECIPE: short recipe: docs/running.md Windows NVIDIA recipe, pipeline cache warm, 330 s cap, scripted button presses from 60 s | build RelWithDebInfo, only the PR's targets built TESTS: - gfx10_descriptors_test (ctest gfx10_descriptors): pass on the PR | fails on main: does not compile on main (the PR's test calls the sampler mapping with a third argument that main's function does not take) GAME: session=1 at 130 s | world entered at 185 s | last window >= 1 img/s ends at 267 s | 0 frames after world entry + 240 s | end: time limit (cap 330 s, ended at 334 s) | device loss: no (no fault report) | private RAM max 17032 MB COMPARED TO: w77 (main ec91d695c, same short recipe): session=1 at 145 s, world at 195 s, last window >= 1 img/s at 293 s, private RAM max 16043 MB, ended by the time limit (337 s) w79 (main, same short recipe): world at 200 s, last window >= 1 img/s at 286 s, private RAM max 16583 MB, ended by the time limit (350 s) one run each (n=1); on main the spread of world entry on this recipe is about 165 to 200 s, so no conclusion on timings VERDICT: unit test passes and does not compile on main (new API); game run clean to the time limit, no device loss; no timing conclusion (n=1) ``` Reading (marked): - MEASURED: the display stops after the world is entered (82 s after world entry for the last window >= 1 img/s here; 98 s on w77, 86 s on w79). Present on main too, not caused by this PR (finding https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7224692645). - MEASURED: the run reached the time limit without a device loss; this says the PR does not break the game boot on this machine, not that it changes anything in the game. - The game logs of this run were deleted by a disk cleanup before this write-up; the figures above were extracted before that and cannot be re-checked from the logs now. Limits: one machine, one run for the PR, one run for each main witness. AI-assisted (Claude Code, Claude Opus 5.5)
timbot103 commented 2026-11-28 02:02:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:19Z.


Reviewed at head 2c56db700 on Windows 11 (MSVC 2022 19.44).

Verification

  • Built gfx10_descriptors_test and gta6rt.
  • gfx10_descriptors_test: passed.

Notes

  • Enabling Vulkan anisotropy only when an anisotropic XY filter is active and ratio > 1, clamping to the physical device's maxSamplerAnisotropy in sampler creation, and preserving feature-disabled and unnormalized-coordinate fallbacks (gfx10_descriptors.h:582-711, d3d12_vulkan_device.cpp:7772-7781, 14401-14407, 15053-15056, 22267-22271) all match Vulkan VkSamplerCreateInfo valid usage cleanly.

Approve.

AI-assisted review + local MSVC verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232086148 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475#issuecomment-7232086148). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-28T02:02:19Z. --- Reviewed at head `2c56db700` on Windows 11 (MSVC 2022 `19.44`). ### Verification - Built `gfx10_descriptors_test` and `gta6rt`. - `gfx10_descriptors_test`: **passed**. ### Notes - Enabling Vulkan anisotropy only when an anisotropic XY filter is active and ratio > 1, clamping to the physical device's `maxSamplerAnisotropy` in sampler creation, and preserving feature-disabled and unnormalized-coordinate fallbacks (`gfx10_descriptors.h:582-711`, `d3d12_vulkan_device.cpp:7772-7781`, `14401-14407`, `15053-15056`, `22267-22271`) all match Vulkan `VkSamplerCreateInfo` valid usage cleanly. Approve. AI-assisted review + local MSVC verification.
lixonik commented 2026-11-28 10:37:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T10:37:25Z.

Review: APPROVED


Reviewed 2c56db700 and verified both unit tests and COM library compilation.

Code audit:

  • runtime/src/gfx10_descriptors.h: anisotropyEnable is now only set when mag_filter or min_filter uses an anisotropic filter (aniso_point / aniso_bilinear), and maxAnisotropy is clamped to limits.maxSamplerAnisotropy (VUID-VkSamplerCreateInfo-anisotropyEnable-01071).
  • runtime/shims/d3d12_vulkan_device.cpp: passes device.info.properties.limits.maxSamplerAnisotropy into the sampler decoder.

Verification (Windows 11, MSVC 19.44, Ninja Release):

  • Built gfx10_descriptors_test and gta6rt_d3d12_com (verifying d3d12_vulkan_device.cpp).
  • ctest -R '^gfx10_descriptors$': 1/1 passed.
  • python -I scripts/check_no_game_data.py: passed.

AI-assisted (Antigravity, Gemini).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6097267984 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475#pullrequestreview-6097267984). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-28T10:37:25Z. **Review:** APPROVED --- Reviewed `2c56db700` and verified both unit tests and COM library compilation. Code audit: - `runtime/src/gfx10_descriptors.h`: `anisotropyEnable` is now only set when `mag_filter` or `min_filter` uses an anisotropic filter (`aniso_point` / `aniso_bilinear`), and `maxAnisotropy` is clamped to `limits.maxSamplerAnisotropy` (`VUID-VkSamplerCreateInfo-anisotropyEnable-01071`). - `runtime/shims/d3d12_vulkan_device.cpp`: passes `device.info.properties.limits.maxSamplerAnisotropy` into the sampler decoder. Verification (Windows 11, MSVC 19.44, Ninja Release): - Built `gfx10_descriptors_test` and `gta6rt_d3d12_com` (verifying `d3d12_vulkan_device.cpp`). - `ctest -R '^gfx10_descriptors$'`: 1/1 passed. - `python -I scripts/check_no_game_data.py`: passed. AI-assisted (Antigravity, Gemini).
zmasi commented 2026-11-28 22:32:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:32:33Z.


#2475 | head 2c56db7004 (merged cleanly with main c7753ed98a) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^(gfx10_descriptors|d3d12_sampler2|d3d12_descriptor|d3d12_compute)$" --output-on-failure (LEONIDA_VK_VALIDATION=1) | red on main: gfx10_descriptors_test fails to compile against main's 2-arg vulkan_sampler (error C2660 at lines 403 and 406), and with the two 3-arg limit checks omitted it fails behaviorally at line 398: info.anisotropyEnable == VK_FALSE && info.maxAnisotropy == 1.0f on a bilinear S# with MAX_ANISO_RATIO = 16 | green on PR+main: 4/4 CTests pass on RTX 3090 (gfx10_descriptors, d3d12_sampler2, d3d12_descriptor, d3d12_compute) under LEONIDA_VK_VALIDATION=1 (VUID-VkSamplerCreateInfo-anisotropyEnable-01071 active) 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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246808489 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475#issuecomment-7246808489). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:32:33Z. --- #2475 | head 2c56db70040e6a811afc00477be4a79cca44e201 (merged cleanly with main c7753ed98a56677f10e34078b37eab0540e190ec) | `ctest --test-dir runtime/build -C RelWithDebInfo -R "^(gfx10_descriptors|d3d12_sampler2|d3d12_descriptor|d3d12_compute)$" --output-on-failure` (`LEONIDA_VK_VALIDATION=1`) | red on main: `gfx10_descriptors_test` fails to compile against `main`'s 2-arg `vulkan_sampler` (`error C2660` at lines `403` and `406`), and with the two 3-arg limit checks omitted it fails behaviorally at `line 398: info.anisotropyEnable == VK_FALSE && info.maxAnisotropy == 1.0f` on a bilinear S# with `MAX_ANISO_RATIO = 16` | green on PR+main: `4/4` CTests pass on RTX 3090 (`gfx10_descriptors`, `d3d12_sampler2`, `d3d12_descriptor`, `d3d12_compute`) under `LEONIDA_VK_VALIDATION=1` (`VUID-VkSamplerCreateInfo-anisotropyEnable-01071` active) 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
timbot103 commented 2026-11-29 04:29:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:29:31Z.

Review: COMMENTED


Reviewed 2c56db700 and found no defects in the change. This was a static audit only, with no builds, test executions, or GPU runs.

  • runtime/src/gfx10_descriptors.h:582 decodes the ratio and XY filters independently. The mapping at runtime/src/gfx10_descriptors.h:666 enables anisotropy only when either XY filter is aniso_point or aniso_bilinear and the ratio exceeds 1. Point and bilinear S# values map to disabled anisotropy and maxAnisotropy = 1.0f.
  • runtime/shims/d3d12_vulkan_device.cpp:14401 encodes regular, comparison, minimum, and maximum D3D12 anisotropic filters as anisotropic XY filters. Comparison and reduction retain their separate S# fields. Sampler creation at runtime/shims/d3d12_vulkan_device.cpp:7770 checks the enabled samplerAnisotropy feature and supplies the physical device limit read at runtime/shims/d3d12_vulkan_device.cpp:15056. Enabled anisotropy stays within [1.0, maxSamplerAnisotropy], and unnormalized coordinates still disable it.
  • The cache and shader lookup both use the four original S# words followed by four 0xFFFFFFFF words. The Vulkan clamp operates on sampler creation parameters. See runtime/src/descriptor_table.h:97 and tools/rdna2spirv.py:13774.
  • runtime/test/gfx10_descriptors_test.cpp:395 covers plain point and bilinear filters with nontrivial ratios, raw S# decoding, anisotropic point and bilinear filters, and requests above and below the supplied cap. The Windows shim uses its existing Vulkan properties query, and the header and tests use portable C++20 with Vulkan headers. See runtime/CMakeLists.txt:4 and runtime/CMakeLists.txt:4747.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6101402172 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475#pullrequestreview-6101402172). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-29T04:29:31Z. **Review:** COMMENTED --- Reviewed `2c56db700` and found no defects in the change. This was a static audit only, with no builds, test executions, or GPU runs. - `runtime/src/gfx10_descriptors.h:582` decodes the ratio and XY filters independently. The mapping at `runtime/src/gfx10_descriptors.h:666` enables anisotropy only when either XY filter is `aniso_point` or `aniso_bilinear` and the ratio exceeds 1. Point and bilinear S# values map to disabled anisotropy and `maxAnisotropy = 1.0f`. - `runtime/shims/d3d12_vulkan_device.cpp:14401` encodes regular, comparison, minimum, and maximum D3D12 anisotropic filters as anisotropic XY filters. Comparison and reduction retain their separate S# fields. Sampler creation at `runtime/shims/d3d12_vulkan_device.cpp:7770` checks the enabled `samplerAnisotropy` feature and supplies the physical device limit read at `runtime/shims/d3d12_vulkan_device.cpp:15056`. Enabled anisotropy stays within `[1.0, maxSamplerAnisotropy]`, and unnormalized coordinates still disable it. - The cache and shader lookup both use the four original S# words followed by four `0xFFFFFFFF` words. The Vulkan clamp operates on sampler creation parameters. See `runtime/src/descriptor_table.h:97` and `tools/rdna2spirv.py:13774`. - `runtime/test/gfx10_descriptors_test.cpp:395` covers plain point and bilinear filters with nontrivial ratios, raw S# decoding, anisotropic point and bilinear filters, and requests above and below the supplied cap. The Windows shim uses its existing Vulkan properties query, and the header and tests use portable C++20 with Vulkan headers. See `runtime/CMakeLists.txt:4` and `runtime/CMakeLists.txt:4747`. AI-assisted.
TheGeogeo commented 2026-11-29 14:17:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:17:55Z.


Tested 2c56db700 merged (no commit) with main 8fb974878: MSVC 19.52, Windows 11 10.0.26300.
GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40.

  • Green: gfx10_descriptors passes. The 289 relinked CTests pass, except xbox_present, which fails on main too (its resize case).
  • Red: with runtime/shims/d3d12_vulkan_device.cpp and runtime/src/gfx10_descriptors.h back to main, the test does not compile (gfx10_descriptors_test.cpp(403): C2660, main's vulkan_sampler takes 2 arguments). No runtime red was shown here.
  • gta6rt links with nothing new over main: no new unresolved symbol, same imports.
  • Merge order: conflicts with #2089 in runtime/src/gfx10_descriptors.h. Whichever lands second needs a rebase.
  • No game data check passes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257194158 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475#issuecomment-7257194158). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:17:55Z. --- Tested 2c56db700 merged (no commit) with main 8fb974878: MSVC 19.52, Windows 11 10.0.26300. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40. - Green: `gfx10_descriptors` passes. The 289 relinked CTests pass, except `xbox_present`, which fails on main too (its resize case). - Red: with `runtime/shims/d3d12_vulkan_device.cpp` and `runtime/src/gfx10_descriptors.h` back to main, the test does not compile (`gfx10_descriptors_test.cpp(403)`: `C2660`, main's `vulkan_sampler` takes 2 arguments). No runtime red was shown here. - `gta6rt` links with nothing new over main: no new unresolved symbol, same imports. - Merge order: conflicts with #2089 in `runtime/src/gfx10_descriptors.h`. Whichever lands second needs a rebase. - No game data check passes. AI-assisted (Claude Code).
merzleckeier commented 2026-11-29 14:36:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T14:36:09Z.


Independent native Vulkan A/B for #2475 at 2c56db700 integrated on 8c527753c. I adapted vk_sampler_test to use a red/green directional pattern at mip 0, solid blue at mip 1, and GLSL textureGrad at 4:1 and 16:1. Both builds take the same handwritten S# words and create real VkSamplers from vulkan_sampler(decode(S#)). The baseline swaps only gfx10_descriptors.h back to main. This exercises the mapping and GPU sampling directly.

36 draws, 4,096 RGBA32F pixels per draw. Each row below gives the result per GPU, for AMD Raphael iGPU (RADV Mesa 26.3.1-arch3.5) and RTX 4070 SUPER (NVIDIA 620.73.04) on Linux.

Compared outputs Main mismatches PR mismatches
Ordinary bilinear with S# ratio 16 vs ordinary bilinear with ratio 1 4,096 0
Ordinary point with S# ratio 16 vs ordinary point with ratio 1 4,096 0
Anisotropic min filter at ratio 16 with cap 4 vs explicit ratio 4 2,048 0

True 16x anisotropy (enabled via either the min or the mag filter) was pixel-identical to its baseline output and differed from the ordinary bilinear reference. Both devices report a physical limit of 16. For the cap case I passed an artificial limit of 4 to the helper, and the printed create info plus GPU readback confirmed that the PR used 4. The probe calls the shared mapping helper directly. gfx10_descriptors_test passed, and Khronos validation reported no errors across the draws.

AI-assisted, offline, synthetic inputs.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257430937 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475#issuecomment-7257430937). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-11-29T14:36:09Z. --- Independent native Vulkan A/B for #2475 at `2c56db700` integrated on `8c527753c`. I adapted `vk_sampler_test` to use a red/green directional pattern at mip 0, solid blue at mip 1, and GLSL `textureGrad` at 4:1 and 16:1. Both builds take the same handwritten S# words and create real VkSamplers from `vulkan_sampler(decode(S#))`. The baseline swaps only `gfx10_descriptors.h` back to main. This exercises the mapping and GPU sampling directly. 36 draws, 4,096 RGBA32F pixels per draw. Each row below gives the result per GPU, for AMD Raphael iGPU (RADV Mesa 26.3.1-arch3.5) and RTX 4070 SUPER (NVIDIA 620.73.04) on Linux. | Compared outputs | Main mismatches | PR mismatches | | --- | ---: | ---: | | Ordinary bilinear with S# ratio 16 vs ordinary bilinear with ratio 1 | 4,096 | 0 | | Ordinary point with S# ratio 16 vs ordinary point with ratio 1 | 4,096 | 0 | | Anisotropic min filter at ratio 16 with cap 4 vs explicit ratio 4 | 2,048 | 0 | True 16x anisotropy (enabled via either the min or the mag filter) was pixel-identical to its baseline output and differed from the ordinary bilinear reference. Both devices report a physical limit of 16. For the cap case I passed an artificial limit of 4 to the helper, and the printed create info plus GPU readback confirmed that the PR used 4. The probe calls the shared mapping helper directly. `gfx10_descriptors_test` passed, and Khronos validation reported no errors across the draws. AI-assisted, offline, synthetic inputs.
aslan2142 commented 2026-12-01 16:44:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:44:58Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7318154042 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2475#issuecomment-7318154042). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:44:58Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

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!2475
No description provided.