WIP: fix(vk): anisotropic filtering leaves clamp-to-border samplers at the game's value, so no white lines at Lon Lon Ranch #896

Draft
HumanBean wants to merge 1 commit from HumanBean/Longshot:fix/aniso-border-lines into main
Owner

Type: fix · Risk: low · Tested on: Linux, game-free checks only · Needs: AMD GPU (RX 9070 XT / RX 7800 XT), Lon Lon Ranch

Why

At Lon Lon Ranch thin white lines cut across textures along the edges of what moves with the player. Two players on AMD cards saw it, and setting Anisotropic filtering to Native removes it. Fixes #834. Possibly the same cause as the open worklist item 0.4 (white outlines with anisotropic filtering raised).

How to reproduce

Seen on: RX 9070 XT (Windows 11), RX 7800 XT (CachyOS)
Settings and switches: Anisotropic filtering above Game's (16x default), FSR 4
Steps: Lon Lon Ranch (the chicken coop interior in the report), look at the floor and walls around Link
Expected: no lines
Actual: thin white lines along triangle edges around the player

What changed

The Anisotropic filtering row raises the game's sampler anisotropy on every linear mipmapped sampler. It now skips samplers with a clamp-to-border address mode, which keep the game's own value. The idea: a widened footprint at a triangle's edge reaches past the texture and returns the border colour, white for the game's projected textures. This cause is a hypothesis; the log doesn't name the sampler.

  • sampler_make in gpu/vk/vk_draw.cpp: skip the raise when any wrap axis is clamp-to-border; RX_VK_ANISO_BORDER=1 raises them as before.
  • README: the Anisotropic filtering row's note.

Measurements

Verdict: Not measured: no game run yet. Whether the lines go is what Testing asks for.

Flags and settings

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_ANISO_BORDER raise anisotropy on clamp-to-border samplers too n/a (always raised) off the old behaviour when set untested off: only for A/B

Testing

Tested: python -I -B tests/run_all.py on Linux: 505 passed, 19 failed, 70 skipped. None of the 19 is about samplers; I reran the two that read vk_draw.cpp (test_pipeline_tour, test_program_cache_one_variant) on the base commit and they fail the same way there (sandboxed run: sockets and disk). The other 17 I did not rerun on the base.

Not tested: in the game; any GPU.

Must be tested:

  • AMD (RX 9070 XT or 7800 XT), Windows or Linux: Lon Lon Ranch coop, Anisotropic filtering 16x, expecting no white lines; then RX_VK_ANISO_BORDER=1, expecting them back (Test Farm: @Beanstalk amd, Lon Lon Ranch coop at 16x anisotropic filtering, looking for white lines near the player)

Risks

What could break: bordered samplers lose the raised anisotropy (slightly blurrier at a slant). If the cause is wrong the lines stay.

Turning it off: RX_VK_ANISO_BORDER=1, or revert the commit.

Compatibility: Nothing changes.

Issues

Fixes #834

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure. (verdict: not measured yet)
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). (19 fail here; 2 confirmed failing on the base, 17 not yet checked)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Docs updated.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Linux, game-free checks only · **Needs:** AMD GPU (RX 9070 XT / RX 7800 XT), Lon Lon Ranch ## Why At Lon Lon Ranch thin white lines cut across textures along the edges of what moves with the player. Two players on AMD cards saw it, and setting Anisotropic filtering to Native removes it. Fixes https://git.magicbean.dev/MagicBeanDev/Longshot/issues/834. Possibly the same cause as the open worklist item 0.4 (white outlines with anisotropic filtering raised). ## How to reproduce **Seen on:** RX 9070 XT (Windows 11), RX 7800 XT (CachyOS) **Settings and switches:** Anisotropic filtering above Game's (16x default), FSR 4 **Steps:** Lon Lon Ranch (the chicken coop interior in the report), look at the floor and walls around Link **Expected:** no lines **Actual:** thin white lines along triangle edges around the player ## What changed The Anisotropic filtering row raises the game's sampler anisotropy on every linear mipmapped sampler. It now skips samplers with a clamp-to-border address mode, which keep the game's own value. The idea: a widened footprint at a triangle's edge reaches past the texture and returns the border colour, white for the game's projected textures. This cause is a hypothesis; the log doesn't name the sampler. - `sampler_make` in `gpu/vk/vk_draw.cpp`: skip the raise when any wrap axis is clamp-to-border; `RX_VK_ANISO_BORDER=1` raises them as before. - README: the Anisotropic filtering row's note. ## Measurements **Verdict:** Not measured: no game run yet. Whether the lines go is what Testing asks for. ### Flags and settings | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | RX_VK_ANISO_BORDER | raise anisotropy on clamp-to-border samplers too | n/a (always raised) | off | the old behaviour when set | untested | off: only for A/B | ## Testing **Tested:** `python -I -B tests/run_all.py` on Linux: 505 passed, 19 failed, 70 skipped. None of the 19 is about samplers; I reran the two that read `vk_draw.cpp` (`test_pipeline_tour`, `test_program_cache_one_variant`) on the base commit and they fail the same way there (sandboxed run: sockets and disk). The other 17 I did not rerun on the base. **Not tested:** in the game; any GPU. **Must be tested:** - AMD (RX 9070 XT or 7800 XT), Windows or Linux: Lon Lon Ranch coop, Anisotropic filtering 16x, expecting no white lines; then `RX_VK_ANISO_BORDER=1`, expecting them back (Test Farm: @Beanstalk amd, Lon Lon Ranch coop at 16x anisotropic filtering, looking for white lines near the player) ## Risks **What could break:** bordered samplers lose the raised anisotropy (slightly blurrier at a slant). If the cause is wrong the lines stay. **Turning it off:** `RX_VK_ANISO_BORDER=1`, or revert the commit. **Compatibility:** Nothing changes. ## Issues Fixes https://git.magicbean.dev/MagicBeanDev/Longshot/issues/834 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [ ] Measurements has a verdict, or one line saying why there is nothing to measure. (verdict: not measured yet) - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). (19 fail here; 2 confirmed failing on the base, 17 not yet checked) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(vk): anisotropic filtering leaves clamp-to-border samplers at the game's value, so no white lines at Lon Lon Ranch
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 4s
Third-party parts / As their notes say (pull_request) Successful in 8s
e6a629abc3
Fixes #834

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 4s
Third-party parts / As their notes say (pull_request) Successful in 8s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/aniso-border-lines:HumanBean-fix/aniso-border-lines'
git switch 'HumanBean-fix/aniso-border-lines'
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!896
No description provided.