fix(vk): disable equal_depth_bias on Intel Arc Battlemage (0xE2xx) #1801

Open
tiktiki wants to merge 2 commits from tiktiki/Longshot:fix/intel-battlemage-equal-depth-bias into main
First-time contributor

Type: fix · Risk: low · Tested on: Windows 11, Intel Arc B570 · Needs: Windows, Intel Arc B580 (Death Mountain Trail check)

TL;DR

On discrete Intel Arc Battlemage GPUs on Windows (Arc B570 / B580), alpha-tested objects drawn after a depth prepass—such as fallen leaves, flowers, Link's hair, distant pine cards, and Hyrule Field billboards—rendered as solid opaque rectangles instead of clean cutouts. This PR turns off the Intel depth-bias workaround for discrete Battlemage cards while keeping it enabled on older and integrated Intel Windows GPUs. On an Arc B570, all alpha cutouts render cleanly in Castle Town Market, Hyrule Field, and the equipment menu with no ground holes, and the updated unit tests fail on main and pass here.

Breakdown

  • Who it helps: players on discrete Intel Arc Battlemage GPUs (Arc B570 / B580, PCI ID 0xE2xx) running Windows.
  • What was wrong: turning EQUAL depth tests into LESS_OR_EQUAL with a -64 bias let discarded alpha-tested prepass pixels pass depth over background geometry, drawing opaque quads.
  • What changes: discrete Intel Arc Battlemage GPUs (0xE2xx) default to equal_depth_bias = 0 on Intel's Windows driver instead of 64.
  • What does not change: older and integrated Intel Windows GPUs (UHD, Arc Alchemist 0x56xx, Panther Lake / Arc B390 0xB0xx) keep 64, Mesa ANV / AMD / NVIDIA keep 0, RX_VK_EQ_BIAS still overrides the default, and saves/caches stay compatible.
  • How it was checked: verified in-game on Windows 11 with an Intel Arc B570 (32.0.101.9175) across Castle Town Market, Hyrule Field, and the equipment menu, plus updated game-free unit tests (test_device_policy.py and test_equal_depth_margin.py).
  • What is still open: verifying Death Mountain Trail and Arc B580 (0xE20B) for any ground holes without the depth margin.
  • Risk: low; if any Battlemage driver or area still shows depth-precision holes, setting RX_VK_EQ_BIAS=64 restores the previous behaviour immediately without rebuilding caches.

Why

On Windows, Intel's proprietary Vulkan driver currently receives equal_depth_bias = 64.0f for every Intel GPU family. When equal_depth_bias > 0, non-blended colour passes that request VK_COMPARE_OP_EQUAL after a Z-prepass are rewritten to VK_COMPARE_OP_LESS_OR_EQUAL with a -64 depth bias. For alpha-tested Z-prepass geometry (fallen leaves, flowers, Link's hair strands, distant pine silhouettes, and Hyrule Field billboards), pixels discarded during the Z-prepass leave the farther background depth behind them; relaxing EQUAL to LESS_OR_EQUAL with a negative bias lets those discarded quad pixels pass the depth test, rendering solid opaque or black rectangles.

While PR #1586 already disabled this workaround on Mesa ANV, discrete Intel Arc Battlemage GPUs on Windows (0xE2xx, e.g. Arc B570 0xE20C / Arc B580 0xE20B) still hit the opaque-cutout bug on main. See #1413.

How to reproduce

Seen on: Windows 11 (build 26300), Intel Arc B570 10 GB (0x8086:0xE20C), Intel driver 32.0.101.9175.
Settings and switches: defaults (no RX_VK_EQ_BIAS override).
Steps: load into Hyrule Castle Town Market, look at fallen leaves on the cobblestone ground, potted flowers, Link's hair, and the pine trees behind the Temple of Time stairs; then walk into Hyrule Field.
Expected: fallen leaves, flowers, hair strands, pine foliage, and distant billboards keep clean alpha-tested cutouts.
Actual: discarded alpha-tested regions pass depth and render as solid opaque green/purple squares on leaves and flowers, dark silhouettes behind pine trees, black fringes on Link's hair, and a floating black rectangle in Hyrule Field.

What changed

The default equal_depth_bias selection is extracted into a small pure rule that returns 0.0f for discrete Intel Arc Battlemage (0xE2xx) while preserving 64.0f for older and integrated Intel Windows GPUs and 0.0f for all other drivers. The policy test suite and equal-depth-margin source check are updated to cover Battlemage (B570 / B580) and verify older Intel families remain unchanged.

  • gpu/vk/device_policy.h: add policy_rule::equal_depth_bias(VkDriverId driver, uint32_t device) returning 0.0f for non-Intel-Windows drivers and discrete Battlemage ((device & 0xFF00u) == 0xE200u), and 64.0f for earlier/integrated Intel Windows families; call it from device_policy() and update the equal_depth_bias field comment.
  • tests/test_device_policy.py: update the Arc B580, Intel's Windows driver 101.9154 fixture to expect equal_depth_bias = 0, add an Arc B570, Intel's Windows driver 101.9175 (0xE20C) fixture, and add 7 rule-edge checks for policy_rule::equal_depth_bias.
  • tests/test_equal_depth_margin.py: update the source check to verify device_policy() calls policy_rule::equal_depth_bias(f.driver_id, f.device_id) and that the rule excludes 0xE200u while keeping 64.0f for other Intel Windows GPUs.

Measurements

Verdict: pass — alpha-tested Z-prepass cutouts render cleanly on Intel Arc B570 (equal_depth_bias = 0) with zero ground holes observed, and the updated test_device_policy.py fails on main @ 621dae5 and passes on this PR @ e739aef.

Baseline: in-game build tested on v3.0.0-rc.8 (same equal_depth_bias consumer in vk_draw.cpp and same Intel Windows 64.0f default as main @ 621dae5) with a locally compiled longshot_vk.dll carrying the exact equal_depth_bias = 0 Battlemage rule and no RX_VK_EQ_BIAS override; unit tests run directly on main @ 621dae5 vs this PR @ e739aef.
Hardware: Windows 11 (build 26300), Intel Arc B570 10 GB (0x8086:0xE20C, driver 32.0.101.9175), AMD Ryzen 5 5600 (6C/12T), 16 GB RAM.
Scene: Hyrule Castle Town Market, Temple of Time stairs, Hyrule Field, and Equipment menu; 2560x1440, Intel XeSS Balanced, 60 FPS cap, frame generation off.
Method: visual inspection of alpha-tested Z-prepass cutouts before/after (equal_depth_bias = 64 vs 0) and execution of tests/test_device_policy.py and tests/test_equal_depth_margin.py.
How to reproduce: run python -I -B tests/test_device_policy.py --headers <vulkan-headers> --cxx clang++ and python -I -B tests/test_equal_depth_margin.py, and visit Castle Town Market and Hyrule Field on an Arc B570/B580 on Windows without RX_VK_EQ_BIAS.

Before: main @ 621dae5 After: this PR @ e739aef
policy_rule::equal_depth_bias on Arc B570 (0xE20C) / B580 (0xE20B) 64 (opaque alpha-cutout quads) 0 (clean alpha cutouts)
tests/test_device_policy.py (with Arc B570/B580 = 0 check) fails (Arc B580 returns 64) passes (20 PCs, 69 fields, 62 rule edges)
tests/test_equal_depth_margin.py passes old rule (64 for all Intel Windows) passes updated rule (0 on 0xE2xx, 64 on older Intel Windows)
ok: 20 PCs, each of DevicePolicy's 69 fields as the rules have it; 64 environments through the switches' one rule; 62 rule edges; the log block under 900 characters a line; the facts filled before the device and the moved sites reading the policy
EQUAL depth margin ok

Flags and settings

None

Testing

Tested:

  • Windows 11, Intel Arc B570 (0x8086:0xE20C), driver 32.0.101.9175: ran the game locally with equal_depth_bias = 0 (compiled longshot_vk.dll without RX_VK_EQ_BIAS set) in Hyrule Castle Town Market, Hyrule Field, and the Equipment menu; fallen leaves, flowers, Link's hair, distant pines, and Hyrule Field rendered cleanly with no opaque quads and no ground holes.
  • Game-free checks on Windows (llvm-mingw Clang 23): tests/test_device_policy.py (pass), tests/test_equal_depth_margin.py (pass), tests/run_all.py --changed main (21/22 passed; the 1 failure, tests/test_vk_occlusion_queries.py, is a pre-existing failure on main @ 621dae5 due to no member named 'policy' in its fixture). Full tests/run_all.py ran 814 checks (755 passed, 59 unrelated failures on this Windows environment where clang lacks MSVC <algorithm> headers or shallow-clone history, 52 skipped).

Not tested: Death Mountain Trail ground on Intel Arc B570/B580 (not reached on this save yet) and Intel Arc B580 (0xE20B) hardware directly.

Must be tested:

  • Windows, Intel Arc B580 (0xE20B) or Arc B570 (0xE20C) on Death Mountain Trail and Castle Town Market: walk through Castle Town Market and Death Mountain Trail without RX_VK_EQ_BIAS set, expecting clean alpha cutouts on leaves/hair/trees and no sky-through-ground holes (by hand: inspect leaves, Link's hair, and Death Mountain Trail ground on a Battlemage card, or Test Farm: @Beanstalk windows intel if a Battlemage node is available).

Risks

What could break: if a specific area (such as Death Mountain Trail) or an older Battlemage driver version still has depth-precision mismatch between depth and colour passes on 0xE2xx, small holes could appear in EQUAL-tested terrain. Older and integrated Intel Windows GPUs (UHD, Arc A-series, Arc B390 / 0xB0xx) are completely unaffected and keep equal_depth_bias = 64.

Turning it off: set RX_VK_EQ_BIAS=64 in longshot_env.txt (or environment) to restore the previous margin immediately, or revert the commit.

Compatibility: Nothing changes for saves, longshot_options.ini, shader/pipeline caches (no pipeline cache or SPIR-V invalidation), MKWVK_API_VERSION, or builder tools.

Issues

See #1413

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).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks.
  • 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).
  • 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.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
**Type:** fix · **Risk:** low · **Tested on:** Windows 11, Intel Arc B570 · **Needs:** Windows, Intel Arc B580 (Death Mountain Trail check) ## TL;DR On discrete Intel Arc Battlemage GPUs on Windows (Arc B570 / B580), alpha-tested objects drawn after a depth prepass—such as fallen leaves, flowers, Link's hair, distant pine cards, and Hyrule Field billboards—rendered as solid opaque rectangles instead of clean cutouts. This PR turns off the Intel depth-bias workaround for discrete Battlemage cards while keeping it enabled on older and integrated Intel Windows GPUs. On an Arc B570, all alpha cutouts render cleanly in Castle Town Market, Hyrule Field, and the equipment menu with no ground holes, and the updated unit tests fail on main and pass here. ## Breakdown - **Who it helps:** players on discrete Intel Arc Battlemage GPUs (Arc B570 / B580, PCI ID `0xE2xx`) running Windows. - **What was wrong:** turning `EQUAL` depth tests into `LESS_OR_EQUAL` with a `-64` bias let discarded alpha-tested prepass pixels pass depth over background geometry, drawing opaque quads. - **What changes:** discrete Intel Arc Battlemage GPUs (`0xE2xx`) default to `equal_depth_bias = 0` on Intel's Windows driver instead of `64`. - **What does not change:** older and integrated Intel Windows GPUs (UHD, Arc Alchemist `0x56xx`, Panther Lake / Arc B390 `0xB0xx`) keep `64`, Mesa ANV / AMD / NVIDIA keep `0`, `RX_VK_EQ_BIAS` still overrides the default, and saves/caches stay compatible. - **How it was checked:** verified in-game on Windows 11 with an Intel Arc B570 (`32.0.101.9175`) across Castle Town Market, Hyrule Field, and the equipment menu, plus updated game-free unit tests (`test_device_policy.py` and `test_equal_depth_margin.py`). - **What is still open:** verifying Death Mountain Trail and Arc B580 (`0xE20B`) for any ground holes without the depth margin. - **Risk:** low; if any Battlemage driver or area still shows depth-precision holes, setting `RX_VK_EQ_BIAS=64` restores the previous behaviour immediately without rebuilding caches. ## Why On Windows, Intel's proprietary Vulkan driver currently receives `equal_depth_bias = 64.0f` for every Intel GPU family. When `equal_depth_bias > 0`, non-blended colour passes that request `VK_COMPARE_OP_EQUAL` after a Z-prepass are rewritten to `VK_COMPARE_OP_LESS_OR_EQUAL` with a `-64` depth bias. For alpha-tested Z-prepass geometry (fallen leaves, flowers, Link's hair strands, distant pine silhouettes, and Hyrule Field billboards), pixels discarded during the Z-prepass leave the farther background depth behind them; relaxing `EQUAL` to `LESS_OR_EQUAL` with a negative bias lets those discarded quad pixels pass the depth test, rendering solid opaque or black rectangles. While PR #1586 already disabled this workaround on Mesa ANV, discrete Intel Arc Battlemage GPUs on Windows (`0xE2xx`, e.g. Arc B570 `0xE20C` / Arc B580 `0xE20B`) still hit the opaque-cutout bug on `main`. See #1413. ## How to reproduce **Seen on:** Windows 11 (build 26300), Intel Arc B570 10 GB (`0x8086:0xE20C`), Intel driver `32.0.101.9175`. **Settings and switches:** defaults (no `RX_VK_EQ_BIAS` override). **Steps:** load into Hyrule Castle Town Market, look at fallen leaves on the cobblestone ground, potted flowers, Link's hair, and the pine trees behind the Temple of Time stairs; then walk into Hyrule Field. **Expected:** fallen leaves, flowers, hair strands, pine foliage, and distant billboards keep clean alpha-tested cutouts. **Actual:** discarded alpha-tested regions pass depth and render as solid opaque green/purple squares on leaves and flowers, dark silhouettes behind pine trees, black fringes on Link's hair, and a floating black rectangle in Hyrule Field. ## What changed The default `equal_depth_bias` selection is extracted into a small pure rule that returns `0.0f` for discrete Intel Arc Battlemage (`0xE2xx`) while preserving `64.0f` for older and integrated Intel Windows GPUs and `0.0f` for all other drivers. The policy test suite and equal-depth-margin source check are updated to cover Battlemage (`B570` / `B580`) and verify older Intel families remain unchanged. - `gpu/vk/device_policy.h`: add `policy_rule::equal_depth_bias(VkDriverId driver, uint32_t device)` returning `0.0f` for non-Intel-Windows drivers and discrete Battlemage (`(device & 0xFF00u) == 0xE200u`), and `64.0f` for earlier/integrated Intel Windows families; call it from `device_policy()` and update the `equal_depth_bias` field comment. - `tests/test_device_policy.py`: update the `Arc B580, Intel's Windows driver 101.9154` fixture to expect `equal_depth_bias = 0`, add an `Arc B570, Intel's Windows driver 101.9175` (`0xE20C`) fixture, and add 7 rule-edge checks for `policy_rule::equal_depth_bias`. - `tests/test_equal_depth_margin.py`: update the source check to verify `device_policy()` calls `policy_rule::equal_depth_bias(f.driver_id, f.device_id)` and that the rule excludes `0xE200u` while keeping `64.0f` for other Intel Windows GPUs. ## Measurements **Verdict:** pass — alpha-tested Z-prepass cutouts render cleanly on Intel Arc B570 (`equal_depth_bias = 0`) with zero ground holes observed, and the updated `test_device_policy.py` fails on `main @ 621dae5` and passes on `this PR @ e739aef`. Baseline: in-game build tested on `v3.0.0-rc.8` (same `equal_depth_bias` consumer in `vk_draw.cpp` and same Intel Windows `64.0f` default as `main @ 621dae5`) with a locally compiled `longshot_vk.dll` carrying the exact `equal_depth_bias = 0` Battlemage rule and no `RX_VK_EQ_BIAS` override; unit tests run directly on `main @ 621dae5` vs `this PR @ e739aef`. Hardware: Windows 11 (build 26300), Intel Arc B570 10 GB (`0x8086:0xE20C`, driver `32.0.101.9175`), AMD Ryzen 5 5600 (6C/12T), 16 GB RAM. Scene: Hyrule Castle Town Market, Temple of Time stairs, Hyrule Field, and Equipment menu; 2560x1440, Intel XeSS Balanced, 60 FPS cap, frame generation off. Method: visual inspection of alpha-tested Z-prepass cutouts before/after (`equal_depth_bias = 64` vs `0`) and execution of `tests/test_device_policy.py` and `tests/test_equal_depth_margin.py`. How to reproduce: run `python -I -B tests/test_device_policy.py --headers <vulkan-headers> --cxx clang++` and `python -I -B tests/test_equal_depth_margin.py`, and visit Castle Town Market and Hyrule Field on an Arc B570/B580 on Windows without `RX_VK_EQ_BIAS`. | | Before: main @ 621dae5 | After: this PR @ e739aef | |---|---|---| | `policy_rule::equal_depth_bias` on Arc B570 (`0xE20C`) / B580 (`0xE20B`) | `64` (opaque alpha-cutout quads) | `0` (clean alpha cutouts) | | `tests/test_device_policy.py` (with Arc B570/B580 = 0 check) | fails (`Arc B580` returns `64`) | passes (`20 PCs`, `69 fields`, `62 rule edges`) | | `tests/test_equal_depth_margin.py` | passes old rule (`64` for all Intel Windows) | passes updated rule (`0` on `0xE2xx`, `64` on older Intel Windows) | ```text ok: 20 PCs, each of DevicePolicy's 69 fields as the rules have it; 64 environments through the switches' one rule; 62 rule edges; the log block under 900 characters a line; the facts filled before the device and the moved sites reading the policy EQUAL depth margin ok ``` ### Flags and settings None ## Testing **Tested:** - Windows 11, Intel Arc B570 (`0x8086:0xE20C`), driver `32.0.101.9175`: ran the game locally with `equal_depth_bias = 0` (compiled `longshot_vk.dll` without `RX_VK_EQ_BIAS` set) in Hyrule Castle Town Market, Hyrule Field, and the Equipment menu; fallen leaves, flowers, Link's hair, distant pines, and Hyrule Field rendered cleanly with no opaque quads and no ground holes. - Game-free checks on Windows (`llvm-mingw` Clang 23): `tests/test_device_policy.py` (pass), `tests/test_equal_depth_margin.py` (pass), `tests/run_all.py --changed main` (21/22 passed; the 1 failure, `tests/test_vk_occlusion_queries.py`, is a pre-existing failure on `main @ 621dae5` due to `no member named 'policy'` in its fixture). Full `tests/run_all.py` ran 814 checks (755 passed, 59 unrelated failures on this Windows environment where clang lacks MSVC `<algorithm>` headers or shallow-clone history, 52 skipped). **Not tested:** Death Mountain Trail ground on Intel Arc B570/B580 (not reached on this save yet) and Intel Arc B580 (`0xE20B`) hardware directly. **Must be tested:** - Windows, Intel Arc B580 (`0xE20B`) or Arc B570 (`0xE20C`) on Death Mountain Trail and Castle Town Market: walk through Castle Town Market and Death Mountain Trail without `RX_VK_EQ_BIAS` set, expecting clean alpha cutouts on leaves/hair/trees and no sky-through-ground holes (by hand: inspect leaves, Link's hair, and Death Mountain Trail ground on a Battlemage card, or Test Farm: `@Beanstalk windows intel` if a Battlemage node is available). ## Risks **What could break:** if a specific area (such as Death Mountain Trail) or an older Battlemage driver version still has depth-precision mismatch between depth and colour passes on `0xE2xx`, small holes could appear in `EQUAL`-tested terrain. Older and integrated Intel Windows GPUs (`UHD`, `Arc A-series`, `Arc B390 / 0xB0xx`) are completely unaffected and keep `equal_depth_bias = 64`. **Turning it off:** set `RX_VK_EQ_BIAS=64` in `longshot_env.txt` (or environment) to restore the previous margin immediately, or revert the commit. **Compatibility:** Nothing changes for saves, `longshot_options.ini`, shader/pipeline caches (no pipeline cache or SPIR-V invalidation), `MKWVK_API_VERSION`, or builder tools. ## Issues See #1413 ## 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). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [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] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
fix(vk): disable equal_depth_bias on Intel Arc Battlemage (0xE2xx)
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 17s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
e739aef5fb
Intel's Windows driver currently sets equal_depth_bias = 64.0f for all Intel GPUs, which rewrites non-blended VK_COMPARE_OP_EQUAL colour passes after a Z-prepass to VK_COMPARE_OP_LESS_OR_EQUAL with a -64 depth bias. On discrete Arc Battlemage (0xE2xx, tested on Arc B570 0xE20C, driver 32.0.101.9175), this makes discarded alpha-tested Z-prepass cutouts (fallen leaves, flowers, Link's hair, distant pine cards and billboards) pass depth over background geometry and render as opaque rectangles (See #1413).

Extract policy_rule::equal_depth_bias(driver, device) returning 0.0f on discrete Battlemage (0xE2xx) while keeping 64.0f on older/integrated Intel Windows families (such as Arc B390 0xB0xx / Arc A750 / UHD) and preserving RX_VK_EQ_BIAS overrides. Add an Arc B570 fixture and rule edge tests to test_device_policy.py and update test_equal_depth_margin.py.

Assisted-by: Antigravity (Google DeepMind)
Author
First-time contributor

Tested in game: Windows 11, Intel Arc B570 (0x8086:0xE20C), driver 32.0.101.9175: ran in Hyrule Castle Town Market, Hyrule Field, and the Equipment menu with equal_depth_bias = 0 (no RX_VK_EQ_BIAS override); fallen leaves, potted flowers, Link's hair, distant pine trees, and Hyrule Field rendered cleanly with no opaque alpha-cutout quads and no ground holes.

Tested in game: Windows 11, Intel Arc B570 (0x8086:0xE20C), driver 32.0.101.9175: ran in Hyrule Castle Town Market, Hyrule Field, and the Equipment menu with equal_depth_bias = 0 (no RX_VK_EQ_BIAS override); fallen leaves, potted flowers, Link's hair, distant pine trees, and Hyrule Field rendered cleanly with no opaque alpha-cutout quads and no ground holes.
Contributor

Panther Lake shows the same bug: the Arc B390 (0x8086:0xB080, Windows 11, driver 101.9150, v3.0.0) has every symptom this PR describes. In Kokiri Forest, the floating dust draws as see-through squares, there are solid black "shadows" behind the foliage, and Link's hair has a dark background. With RX_VK_EQ_BIAS=0 all three are gone (the log shows equal_depth_bias=0*). I checked by eye in a windowed run from the kokiri-start save.

So keeping 64 on 0xB0xx leaves these cards with the bug. #1614 (Arc B370, also Panther Lake: hair and leaves) and #1771 (square shadows behind hair and grass, no GPU given) look like the same thing.

One caution: #1586 says the margin was first made for an Arc B390, so turning it off there could bring back the ground holes it was made for. I haven't checked Death Mountain Trail's ground on the B390 with the margin off. If that is the worry, a per-draw rule like #1631's (no margin for prepass draws whose shader discards) may fit better than a device list.

Panther Lake shows the same bug: the Arc B390 (`0x8086:0xB080`, Windows 11, driver 101.9150, v3.0.0) has every symptom this PR describes. In Kokiri Forest, the floating dust draws as see-through squares, there are solid black "shadows" behind the foliage, and Link's hair has a dark background. With `RX_VK_EQ_BIAS=0` all three are gone (the log shows `equal_depth_bias=0*`). I checked by eye in a windowed run from the `kokiri-start` save. So keeping `64` on `0xB0xx` leaves these cards with the bug. #1614 (Arc B370, also Panther Lake: hair and leaves) and #1771 (square shadows behind hair and grass, no GPU given) look like the same thing. One caution: #1586 says the margin was first made for an Arc B390, so turning it off there could bring back the ground holes it was made for. I haven't checked Death Mountain Trail's ground on the B390 with the margin off. If that is the worry, a per-draw rule like #1631's (no margin for prepass draws whose shader discards) may fit better than a device list.
First-time contributor

Same bug on Lunar Lake, and the same fix holds there. Here's a branch on top of this one that adds it, if you want to take it: twisted89:fix/vk-lnl-equal-depth-on-1801. It's two commits after your e739aef5, so it fast-forwards and your commit stays yours.

What I saw: Windows 11 (26300), Intel Arc 140V (Lunar Lake iGPU, 0x8086:0x64A0), Core Ultra 7 258V, driver 32.0.101.8991. In Kokiri Forest the ivy, leaves and grass drew as solid quads. The log's per-draw state (RX_VK_DUMP_KEY=1) has the foliage colour programs (d8e59341cf4f629c, 6b4dea601798c255, 43ec86f35fd937b9) testing dt1 dw0 against a pre-pass that writes with LESS, and they show dop3 once the margin has turned EQUAL into LESS_OR_EQUAL. That's the cause you describe.

With RX_VK_EQ_BIAS=0 (the log shows equal_depth_bias=0*): the foliage is cut out and the ground in Kokiri Forest has no holes.

The branch:

  • 29dfc056 test(vk): an Arc 140V row in test_device_policy.py with the facts from its log (every field as your branch gives it, the margin 0), and a rule edge for 0x64A0. On your head it fails with exactly those two lines: equal_depth_bias is 64, expected 0.
  • 40b25a8c fix(vk): policy_rule::equal_depth_bias returns 0 for 0x64xx too; the rule's comment says why. It also updates RX_VK_EQ_BIAS's row in switches.def, which still said "64 on Intel's Windows driver" for every Intel GPU on your branch.
  • test_device_policy, test_equal_depth_margin, test_switch_table and test_doc_anchors pass. With the rule pointed at 0x65xx instead, test_device_policy fails again. The whole tests/run_all.py --strict fails nothing on the branch that doesn't fail on your head (Windows; the failures there are this PC's missing tools).

Not done: the build with the branch itself hasn't run on the laptop yet; the evidence is the RX_VK_EQ_BIAS=0 run, which gives the same value. Only driver 101.8991 was tried. Panther Lake (0xB0xx, issue 17's B390) keeps 64, as in your branch.

Same bug on Lunar Lake, and the same fix holds there. Here's a branch on top of this one that adds it, if you want to take it: [twisted89:fix/vk-lnl-equal-depth-on-1801](https://git.magicbean.dev/twisted89/Longshot/src/branch/fix/vk-lnl-equal-depth-on-1801). It's two commits after your e739aef5, so it fast-forwards and your commit stays yours. **What I saw:** Windows 11 (26300), Intel Arc 140V (Lunar Lake iGPU, `0x8086:0x64A0`), Core Ultra 7 258V, driver `32.0.101.8991`. In Kokiri Forest the ivy, leaves and grass drew as solid quads. The log's per-draw state (`RX_VK_DUMP_KEY=1`) has the foliage colour programs (`d8e59341cf4f629c`, `6b4dea601798c255`, `43ec86f35fd937b9`) testing `dt1 dw0` against a pre-pass that writes with LESS, and they show `dop3` once the margin has turned EQUAL into LESS_OR_EQUAL. That's the cause you describe. **With `RX_VK_EQ_BIAS=0`** (the log shows `equal_depth_bias=0*`): the foliage is cut out and the ground in Kokiri Forest has no holes. **The branch:** - `29dfc056` test(vk): an Arc 140V row in `test_device_policy.py` with the facts from its log (every field as your branch gives it, the margin 0), and a rule edge for `0x64A0`. On your head it fails with exactly those two lines: `equal_depth_bias is 64, expected 0`. - `40b25a8c` fix(vk): `policy_rule::equal_depth_bias` returns 0 for `0x64xx` too; the rule's comment says why. It also updates `RX_VK_EQ_BIAS`'s row in `switches.def`, which still said "64 on Intel's Windows driver" for every Intel GPU on your branch. - `test_device_policy`, `test_equal_depth_margin`, `test_switch_table` and `test_doc_anchors` pass. With the rule pointed at `0x65xx` instead, `test_device_policy` fails again. The whole `tests/run_all.py --strict` fails nothing on the branch that doesn't fail on your head (Windows; the failures there are this PC's missing tools). **Not done:** the build with the branch itself hasn't run on the laptop yet; the evidence is the `RX_VK_EQ_BIAS=0` run, which gives the same value. Only driver 101.8991 was tried. Panther Lake (`0xB0xx`, issue 17's B390) keeps 64, as in your branch.
HumanBean left a comment

Recommendation: Request changes. The rule is right and it fixes the alpha cutouts on Battlemage, but the new Arc B570 test row is out of date against main: merged as it is, tests/test_device_policy.py fails on main. It needs a one-word change after a rebase (below). I couldn't push it to the branch. After that it waits on one run: Death Mountain Trail's ground on a Battlemage card with the margin off.

For players on an Arc B570/B580 (and the Pro B50/B60) on Windows, leaves, grass, flowers and Link's hair get clean cutouts again instead of solid squares. The cost: Battlemage loses the 64-unit margin that was kept on Intel's Windows driver for depth holes in the ground. The code is better for it: the one-line default becomes a small named rule with its own rule edges, in the same style as native_fadd_listed beside it.

Does it help: Yes, by eye, for what it fixes. Clean cutouts in Castle Town Market, Hyrule Field and the equipment menu on an Arc B570 (Windows 11, 101.9175), where the 64 margin drew solid squares before. This is not a perf change, so there is nothing to time. Unproven for the ground: nobody has looked at Death Mountain Trail on Battlemage with the margin off, and that is where the margin still did work after invariant positions landed (see Questions).
Other systems: This only changes the policy's default for VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS with a device ID of 0xE2xx. Mesa ANV, AMD, NVIDIA, and Intel's other Windows families (UHD/Iris 0x9Axx, Alchemist 0x56xx, Meteor/Arrow Lake 0x7Dxx, Lunar Lake 0x64xx, Panther Lake 0xB0xx) all keep what they had; the rule edges check that. Nothing is invalidated: the margin is dynamic state in vk_draw.cpp dynamic_state, not in the program cache's stamp, so caches and saves are unaffected. The ID range is right. Every Battlemage part is in 0xE2xx: G21 (E202, E209, E20B B580, E20C B570, E20D, E210, E211 Pro B60, E212 Pro B50, E215, E216) and G31 (E220-E223). No other Intel GPU uses 0xE2xx. native_fadd_listed uses the same mask for Battlemage. The Pro B50/B60 are included, which is right: same Xe2 dGPU, same compiler.
Switches: RX_VK_EQ_BIAS is unchanged as a switch. Its default is now 0 on Battlemage instead of 64. That default is right if Death Mountain Trail holds, and RX_VK_EQ_BIAS=64 is the way back. Its row in gpu/vk/switches.def still says "64 on Intel's Windows driver" for every Intel GPU and needs to name Battlemage (below). No new switch. This is a default, not a player knob, which is right.

Reviewed: e739aef5 against 621dae50 (its merge base; main is 3df5c13e and the PR rebases on it cleanly). Read in full: gpu/vk/device_policy.h (the new rule, the field's comment, device_policy()'s line, and device_policy_env's RX_VK_EQ_BIAS and its log line), tests/test_device_policy.py's new row and rule edges, and tests/test_equal_depth_margin.py. Also read: the consumer in vk_draw.cpp dynamic_state, the RX_VK_EQ_BIAS row in switches.def, and the fixture's on/num check against main. I didn't recompute the B570 row's numbers (texture budget, workers etc.); they come from the author's run on the base. Nothing run (a code review).
Fixed in this review: nothing pushed (the push to the head branch was refused). The fix is under Blocking 1 and Suggestions, as a ready diff.
Checked and fine:

  • the rule returns 0 for every driver but Intel's Windows one, as before, so ANV keeps the 0 it got in #1586;
  • RX_VK_EQ_BIAS is still applied after the default, so =64 restores the old behaviour, and the log's equal_depth_bias=%g* marks it;
  • vk_draw.cpp reads dev.policy.equal_depth_bias once, after the policy is filled;
  • the B580 row's num flips from 64 to 0 and nothing else changes;
  • the new rule edges cover both B5x0 IDs, Alchemist, UHD, Panther Lake, ANV and NVIDIA;
  • test_equal_depth_margin.py now checks the call and the rule's three parts, not the old one-liner, and is no weaker;
  • no third-party, generated or game files.

Blocking (to change before merge)

  1. tests/test_device_policy.py:210: main has turned acquire_ahead on for every PC since this branch's base (every other row on main lists it first in on=). The test checks that every flag not listed is off, so after the squash-merge the new "Arc B570, Intel's Windows driver 101.9175" row fails on main with acquire_ahead. The B580 row merges without trouble because main already edited its on= line. Fix: rebase on main (it is clean) and start the B570 row's on= with acquire_ahead . It is a discrete card, so native_zstd_keep_core (Intel integrated only) and readback_late_newest (handhelds) stay off.

Suggestions (the author may take or leave)

  • gpu/vk/switches.def (RX_VK_EQ_BIAS's row): the default text still says "64 on Intel's Windows driver, 0 (off) elsewhere". Suggested: "64 on Intel's Windows driver but on Battlemage (0xE2xx), 0 (off) there and elsewhere (Mesa's Intel driver too)". The same stale "64 on Intel's Windows driver" is in vk_draw.cpp's comment on static const float eq_bias and in tests/test_equal_depth_margin.py's comment above its eq_bias check. The file docstring of tests/test_device_policy.py says "two Arc cards"; it now has three. (twisted89's branch also fixes the switches.def row.)
  • The new comment cites "issue 17, Arc B390". That is the old Hookshot tracker's number, not Longshot's #17 (a DLSS issue). The neighbouring comments use it the same way, so this is only a note.
  • #1413 was filed on Mesa ANV (B580, CachyOS, rc.7), where the margin was 64 for every Intel GPU then. #1586 already took it off ANV, so this PR fixes the Windows side of the same bug. "See #1413" is fine. Please don't close the issue on this PR's merge alone.

Questions

  • Death Mountain Trail on Battlemage. The margin came on 2026-11-08 for holes in Kokiri Forest's ground (B390), and invariant positions for AMD and Intel landed later that day. The margin did still matter after that: #1631 (2026-11-18, Arc 155H) kept it for the prepass's colour passes because "without it, Death Mountain Trail's ground had holes". The comments here show Kokiri Forest's ground holding with the margin off on a B390 (ertomas) and a 140V (twisted89). So the run that decides this PR is the one its own Testing names: Death Mountain Trail's ground on a B570/B580 with RX_VK_EQ_BIAS unset.
  • Beyond this PR: the same bug shows on Panther Lake (ertomas, B390) and Lunar Lake (twisted89, 140V, branch on top of this one). It looks like the margin itself, on every Intel Windows GPU with alpha-tested prepass draws, not something special to Battlemage. If Death Mountain Trail holds on those too, a follow-up could set the margin to 0 for all of Intel's Windows driver, or limit it to draws whose prepass didn't discard, instead of growing a device list. Not for this PR.

Testing: The author ran it in-game on an Arc B570 (Windows 11, 101.9175): Castle Town Market, Hyrule Field and the equipment menu, with clean cutouts and no holes. They also ran test_device_policy.py and test_equal_depth_margin.py on the base. The comments add the same bug and fix on a B390 (Panther Lake) and a 140V (Lunar Lake), both via RX_VK_EQ_BIAS=0. Still missing: Death Mountain Trail's ground on Battlemage (this holds the merge), and a B580 run (it can't plausibly differ from the B570: same die and same driver). CI is blocked waiting for approval to run; only the description check has run.
Overlaps and merge order: No textual conflicts with the other open PRs on gpu/vk/device_policy.h. #1793 (Lunar Lake float adds) edits the last line of native_fadd_listed and its rule edges. Unchanged lines separate those hunks from this PR's, and the fields don't overlap. #1839 (RDNA 4 by PCI ID) and #1893 (RDNA 4 RADV submits) touch is_rdna4/batch_submits and the AMD fixture rows, far from this. Any order works; each needs only a rebase. twisted89's Lunar Lake branch (on e739aef5) builds on this one and needs a rebase after the fix above.

**Recommendation: Request changes.** The rule is right and it fixes the alpha cutouts on Battlemage, but the new Arc B570 test row is out of date against `main`: merged as it is, `tests/test_device_policy.py` fails on `main`. It needs a one-word change after a rebase (below). I couldn't push it to the branch. After that it waits on one run: Death Mountain Trail's ground on a Battlemage card with the margin off. For players on an Arc B570/B580 (and the Pro B50/B60) on Windows, leaves, grass, flowers and Link's hair get clean cutouts again instead of solid squares. The cost: Battlemage loses the 64-unit margin that was kept on Intel's Windows driver for depth holes in the ground. The code is better for it: the one-line default becomes a small named rule with its own rule edges, in the same style as `native_fadd_listed` beside it. **Does it help:** Yes, by eye, for what it fixes. Clean cutouts in Castle Town Market, Hyrule Field and the equipment menu on an Arc B570 (Windows 11, 101.9175), where the 64 margin drew solid squares before. This is not a perf change, so there is nothing to time. Unproven for the ground: nobody has looked at Death Mountain Trail on Battlemage with the margin off, and that is where the margin still did work after invariant positions landed (see Questions). **Other systems:** This only changes the policy's default for `VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS` with a device ID of `0xE2xx`. Mesa ANV, AMD, NVIDIA, and Intel's other Windows families (UHD/Iris `0x9Axx`, Alchemist `0x56xx`, Meteor/Arrow Lake `0x7Dxx`, Lunar Lake `0x64xx`, Panther Lake `0xB0xx`) all keep what they had; the rule edges check that. Nothing is invalidated: the margin is dynamic state in `vk_draw.cpp dynamic_state`, not in the program cache's stamp, so caches and saves are unaffected. The ID range is right. Every Battlemage part is in `0xE2xx`: G21 (`E202`, `E209`, `E20B` B580, `E20C` B570, `E20D`, `E210`, `E211` Pro B60, `E212` Pro B50, `E215`, `E216`) and G31 (`E220`-`E223`). No other Intel GPU uses `0xE2xx`. `native_fadd_listed` uses the same mask for Battlemage. The Pro B50/B60 are included, which is right: same Xe2 dGPU, same compiler. **Switches:** `RX_VK_EQ_BIAS` is unchanged as a switch. Its default is now 0 on Battlemage instead of 64. That default is right if Death Mountain Trail holds, and `RX_VK_EQ_BIAS=64` is the way back. Its row in `gpu/vk/switches.def` still says "64 on Intel's Windows driver" for every Intel GPU and needs to name Battlemage (below). No new switch. This is a default, not a player knob, which is right. **Reviewed:** e739aef5 against 621dae50 (its merge base; `main` is 3df5c13e and the PR rebases on it cleanly). Read in full: `gpu/vk/device_policy.h` (the new rule, the field's comment, `device_policy()`'s line, and `device_policy_env`'s `RX_VK_EQ_BIAS` and its log line), `tests/test_device_policy.py`'s new row and rule edges, and `tests/test_equal_depth_margin.py`. Also read: the consumer in `vk_draw.cpp dynamic_state`, the `RX_VK_EQ_BIAS` row in `switches.def`, and the fixture's `on`/`num` check against `main`. I didn't recompute the B570 row's numbers (texture budget, workers etc.); they come from the author's run on the base. Nothing run (a code review). **Fixed in this review:** nothing pushed (the push to the head branch was refused). The fix is under Blocking 1 and Suggestions, as a ready diff. **Checked and fine:** - the rule returns 0 for every driver but Intel's Windows one, as before, so ANV keeps the 0 it got in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1586; - `RX_VK_EQ_BIAS` is still applied after the default, so `=64` restores the old behaviour, and the log's `equal_depth_bias=%g*` marks it; - `vk_draw.cpp` reads `dev.policy.equal_depth_bias` once, after the policy is filled; - the B580 row's `num` flips from 64 to 0 and nothing else changes; - the new rule edges cover both B5x0 IDs, Alchemist, UHD, Panther Lake, ANV and NVIDIA; - `test_equal_depth_margin.py` now checks the call and the rule's three parts, not the old one-liner, and is no weaker; - no third-party, generated or game files. **Blocking** (to change before merge) 1. `tests/test_device_policy.py:210`: `main` has turned `acquire_ahead` on for every PC since this branch's base (every other row on `main` lists it first in `on=`). The test checks that every flag not listed is off, so after the squash-merge the new "Arc B570, Intel's Windows driver 101.9175" row fails on `main` with `acquire_ahead`. The B580 row merges without trouble because `main` already edited its `on=` line. Fix: rebase on `main` (it is clean) and start the B570 row's `on=` with `acquire_ahead `. It is a discrete card, so `native_zstd_keep_core` (Intel integrated only) and `readback_late_newest` (handhelds) stay off. **Suggestions** (the author may take or leave) - `gpu/vk/switches.def` (`RX_VK_EQ_BIAS`'s row): the default text still says "64 on Intel's Windows driver, 0 (off) elsewhere". Suggested: `"64 on Intel's Windows driver but on Battlemage (0xE2xx), 0 (off) there and elsewhere (Mesa's Intel driver too)"`. The same stale "64 on Intel's Windows driver" is in `vk_draw.cpp`'s comment on `static const float eq_bias` and in `tests/test_equal_depth_margin.py`'s comment above its `eq_bias` check. The file docstring of `tests/test_device_policy.py` says "two Arc cards"; it now has three. (twisted89's branch also fixes the `switches.def` row.) - The new comment cites "issue 17, Arc B390". That is the old Hookshot tracker's number, not Longshot's https://git.magicbean.dev/MagicBeanDev/Longshot/issues/17 (a DLSS issue). The neighbouring comments use it the same way, so this is only a note. - https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1413 was filed on Mesa ANV (B580, CachyOS, rc.7), where the margin was 64 for every Intel GPU then. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1586 already took it off ANV, so this PR fixes the Windows side of the same bug. "See #1413" is fine. Please don't close the issue on this PR's merge alone. **Questions** - Death Mountain Trail on Battlemage. The margin came on 2026-11-08 for holes in Kokiri Forest's ground (B390), and invariant positions for AMD and Intel landed later that day. The margin did still matter after that: https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1631 (2026-11-18, Arc 155H) kept it for the prepass's colour passes because "without it, Death Mountain Trail's ground had holes". The comments here show Kokiri Forest's ground holding with the margin off on a B390 (ertomas) and a 140V (twisted89). So the run that decides this PR is the one its own Testing names: Death Mountain Trail's ground on a B570/B580 with `RX_VK_EQ_BIAS` unset. - Beyond this PR: the same bug shows on Panther Lake (ertomas, B390) and Lunar Lake (twisted89, 140V, branch on top of this one). It looks like the margin itself, on every Intel Windows GPU with alpha-tested prepass draws, not something special to Battlemage. If Death Mountain Trail holds on those too, a follow-up could set the margin to 0 for all of Intel's Windows driver, or limit it to draws whose prepass didn't discard, instead of growing a device list. Not for this PR. **Testing:** The author ran it in-game on an Arc B570 (Windows 11, 101.9175): Castle Town Market, Hyrule Field and the equipment menu, with clean cutouts and no holes. They also ran `test_device_policy.py` and `test_equal_depth_margin.py` on the base. The comments add the same bug and fix on a B390 (Panther Lake) and a 140V (Lunar Lake), both via `RX_VK_EQ_BIAS=0`. Still missing: Death Mountain Trail's ground on Battlemage (this holds the merge), and a B580 run (it can't plausibly differ from the B570: same die and same driver). CI is blocked waiting for approval to run; only the description check has run. **Overlaps and merge order:** No textual conflicts with the other open PRs on `gpu/vk/device_policy.h`. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1793 (Lunar Lake float adds) edits the last line of `native_fadd_listed` and its rule edges. Unchanged lines separate those hunks from this PR's, and the fields don't overlap. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1839 (RDNA 4 by PCI ID) and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1893 (RDNA 4 RADV submits) touch `is_rdna4`/`batch_submits` and the AMD fixture rows, far from this. Any order works; each needs only a rebase. twisted89's Lunar Lake branch (on e739aef5) builds on this one and needs a rebase after the fix above.
@ -109,0 +113,4 @@
/// discarded them, rendering opaque rectangles (issue #1413); keep it 0 there.
inline float equal_depth_bias(VkDriverId driver, uint32_t device) {
if (driver != VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) return 0.0f;
if ((device & 0xFF00u) == 0xE200u) return 0.0f;
Owner

The range is right: every Battlemage part (G21 E202-E216, incl. B580 E20B, B570 E20C, Pro B60 E211, Pro B50 E212; G31 E220-E223) is 0xE2xx and no other Intel GPU is; same mask as native_fadd_listed.

The range is right: every Battlemage part (G21 E202-E216, incl. B580 E20B, B570 E20C, Pro B60 E211, Pro B50 E212; G31 E220-E223) is 0xE2xx and no other Intel GPU is; same mask as native_fadd_listed.
@ -205,0 +207,4 @@
dict(name="Arc B570, Intel's Windows driver 101.9175",
facts=(0x8086, 0xE20C, "INTEL_PROPRIETARY_WINDOWS", INTEL | 9175, "DISCRETE_GPU", "101.9175", "Intel(R) Arc(TM) B570 Graphics",
1, 0, 10074, 9305, 16311, 12, 12, 6, 1, 1, 1, 0, 0, 1, 1, 32, 32, 0xFF),
on="fetch_bounds networks_left_out gather_offset position_invariant compute_builds_serial pcache_fetch_lock split_before_draw "
Owner

On main every PC now has acquire_ahead on, and this check wants every flag not listed off: after the squash-merge this row fails on main. Rebase (clean) and start this on= with acquire_ahead . A discrete card, so native_zstd_keep_core and readback_late_newest stay off.

On main every PC now has acquire_ahead on, and this check wants every flag not listed off: after the squash-merge this row fails on main. Rebase (clean) and start this on= with `acquire_ahead `. A discrete card, so native_zstd_keep_core and readback_late_newest stay off.
Owner
@fix
Member

I changed this pull request as the review asked: the new head is 7c7dfffd45.

Changed

  • Battlemage policy review: Added acquire_ahead to the B570 row at tests/test_device_policy.py:210 and updated the default description at gpu/vk/switches.def:357. The branch still needs the bot’s base update; the author must inspect Death Mountain Trail’s ground on Battlemage with the margin off. Nothing was run.
  • tests/test_device_policy.py:210 unknown acquire_ahead field: Removed the field from the B570 row because it does not exist at this checkout. After rebasing onto a version that adds it, add it back to the row. No tests were run.

Nothing was built or run: check the change. It will be reviewed again.


Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

I changed this pull request as the review asked: the new head is 7c7dfffd4535. **Changed** - **Battlemage policy review**: Added acquire_ahead to the B570 row at tests/test_device_policy.py:210 and updated the default description at gpu/vk/switches.def:357. The branch still needs the bot’s base update; the author must inspect Death Mountain Trail’s ground on Battlemage with the margin off. Nothing was run. - **tests/test_device_policy.py:210 unknown acquire_ahead field**: Removed the field from the B570 row because it does not exist at this checkout. After rebasing onto a version that adds it, add it back to the row. No tests were run. Nothing was built or run: check the change. It will be reviewed again. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
fix(vk): update Battlemage policy test and switch description
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
CI / Conventional Commit title (pull_request) Successful in 11s
PR description / Description follows the template (pull_request_target) Failing after 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 18s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 20s
7c7dfffd45
As the review on #1801 asked.
BeanBot left a comment

Recommendation: Request changes. The B570 run shows that strict depth equality fixes the cutouts, but disabling the margin across Battlemage could bring back terrain holes. The B570 fixture also needs to match current main before it can merge.

Windows players on discrete Intel Arc Battlemage get the game's original EQUAL depth test by default, restoring clean leaves, flowers, hair and billboards in the reported B570 run. The small policy helper fits the existing code. The trade-off is losing the depth tolerance on every eligible draw, including terrain.

Does it help: Yes on the tested B570 for cutouts. On Windows 11 with driver 101.9175, the author reports that changing the margin from 64 to 0 removed the opaque quads in Castle Town Market, Hyrule Field and the equipment menu, with zero ground holes observed there. The game comparison used v3.0.0-rc.8 and a locally patched renderer. The reported policy test at e739aef covered 20 PC profiles and 62 rule cases. The visual result on B580 and terrain safety on Death Mountain Trail are unproven.
Other systems: The driver and PCI ID checks limit the runtime change to Intel's Windows driver on 0xE2xx. Mesa ANV, AMD, NVIDIA, Steam Deck and other Intel families retain their defaults. Panther Lake and Lunar Lake testers report the same artifact and a successful override in Kokiri Forest, so those reports remain open. The margin is draw-time dynamic state. Shader translation, cache formats, saves, audio, input, the renderer ABI and builder tooling are outside the changed path.
Switches: RX_VK_EQ_BIAS defaults from 64 to 0 on discrete Battlemage with Intel's Windows driver. It stays at 64 on other Intel Windows devices and 0 elsewhere. The switch table reflects the exception, and setting 64 before launch restores the old margin. The B570 result supports the new default for cutouts. Death Mountain Trail still needs verification. The PR's Flags and settings section should record the default change.

Reviewed: 7c7dfffd45 against 621dae5057: Read the full diff and both commits, AGENTS.md, CONTRIBUTING.md, the Forgejo template, the agent PR guidance, gpu/vk/device_policy.h and both changed tests. Read the changed switch row and its neighboring entries, the policy initialization and override, the dynamic-state consumer, the fixture runner and the guide source-check path. Skimmed the rest of the switch table, the guide manifest and historical run records. Read the supplied comments and visible review excerpt. The external Tooling repository and linked Lunar Lake branch were unavailable in this checkout. No review-checklist.md was present.; nothing run (a code review).
Checked and fine:

  • The runtime patch stays on one topic, follows the existing Intel driver and device-mask convention, and adds no game-derived files, build outputs, generated shaders or third-party changes.
  • Vulkan's driver and device IDs are populated before policy calculation. The existing startup override still runs before draw recording, and the helper adds no shared writes, allocation, indexing or platform-specific file access.
  • The compiled PC fixtures catch restoring the old 64-unit Battlemage default. The runner supplies the C++ compiler, and the fixture uses a case-local map for renderer switches.
  • The existing blend exclusion still protects the Death Mountain Trail haze pass. The change affects eligible non-blended EQUAL draws.

Blocking (to change before merge)

  1. tests/test_device_policy.py:210: The new B570 row works against the supplied base, but current main sets acquire_ahead to true for every driver. Retaining this row as written after merging or rebasing makes the policy test expect off and report on for the B570. Rebase onto current main, include acquire_ahead in the B570 row and preserve main's updated B580 flags when resolving the fixture.
  2. tests/test_device_policy.py:427: The new rule checks truncate the float to an integer, as the PC rows also do. If the Battlemage branch returned 0.5f, both would still see 0 while dynamic_state would enable LESS_OR_EQUAL and could bring back the opaque quads. Compare the rule results directly to 0.0f and 64.0f.
  3. gpu/vk/device_policy.h:523: The guide manifest lists this header as a reviewed input for settings-graphics.png, including at its moved path on main. The recorded hash already lags the supplied base, and the PR adds another unreviewed change to that input. Review the Graphics guide image and steps on the rebased branch, then record the retain or recapture decision and update the reviewed-source fingerprints.
  4. The BeanBot fix-up commit 7c7dfffd has no attribution trailer even though the PR checks that box. A comment records the automation, but the commit history lacks it. Add the applicable AI attribution trailer and carry it into the squash commit.

Waiting on the author (a run, a measurement or a decision; no edit does it)

  • gpu/vk/device_policy.h:116: The blanket 0xE2xx exception removes the margin from terrain as well as cutouts. Death Mountain Trail is a known case where strict EQUAL left holes on Intel Windows, and the B570 run skipped the trail. Compare current main and the rebased PR on Windows Battlemage with the override unset, preferably on the still-untested B580. Check the trail ground and the Market cutouts. If the trail develops holes, retain the margin for terrain and narrow the fix.
  • The measurements table credits the clean picture to B570 and B580 and labels the game baseline as main, although the visual run used only B570 on a release-candidate build with a local renderer patch. Update the PR with the actual commits and builds for each result, list the RX_VK_EQ_BIAS default change, and attach the required same-spot before and after screenshots. Record the comparison runs and their logs so the in-game result can be checked against current main.
  • The checked test and platform boxes lack results for the merge candidate. The Windows report names one baseline failure in the changed subset, gives only a total for 59 full-suite failures, and includes no Linux result. Run the checks on the rebased head and its base, name the failures that reproduce on both, and record Windows and Linux build or CI results.

Suggestions (the author may take or leave)

  • Add an explicit fixture case that sets RX_VK_EQ_BIAS=64 on a Battlemage row and checks the resulting value and override marker.

Testing: Read-only review. The reported Windows game-free passes predate the fix-up. The B390 and Lunar Lake comments provide useful override comparisons on those devices. The proposed Lunar Lake branch itself has no reported in-game run, and neither comment establishes Battlemage terrain safety.
Overlaps and merge order: Main already contains the acquire-ahead change from #1574 and the guide move from #1802. Rebase #1801 over both. The Lunar Lake branch in the comments edits the same policy, switch row and tests. If taken forward, rebase it after #1801 and verify its own terrain results. #1631 is already in the base and covers blended haze.


Automated code review by BeanBot (gpt-6.2-sol), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The B570 run shows that strict depth equality fixes the cutouts, but disabling the margin across Battlemage could bring back terrain holes. The B570 fixture also needs to match current main before it can merge. Windows players on discrete Intel Arc Battlemage get the game's original EQUAL depth test by default, restoring clean leaves, flowers, hair and billboards in the reported B570 run. The small policy helper fits the existing code. The trade-off is losing the depth tolerance on every eligible draw, including terrain. **Does it help:** Yes on the tested B570 for cutouts. On Windows 11 with driver 101.9175, the author reports that changing the margin from 64 to 0 removed the opaque quads in Castle Town Market, Hyrule Field and the equipment menu, with zero ground holes observed there. The game comparison used v3.0.0-rc.8 and a locally patched renderer. The reported policy test at e739aef covered 20 PC profiles and 62 rule cases. The visual result on B580 and terrain safety on Death Mountain Trail are unproven. **Other systems:** The driver and PCI ID checks limit the runtime change to Intel's Windows driver on 0xE2xx. Mesa ANV, AMD, NVIDIA, Steam Deck and other Intel families retain their defaults. Panther Lake and Lunar Lake testers report the same artifact and a successful override in Kokiri Forest, so those reports remain open. The margin is draw-time dynamic state. Shader translation, cache formats, saves, audio, input, the renderer ABI and builder tooling are outside the changed path. **Switches:** RX_VK_EQ_BIAS defaults from 64 to 0 on discrete Battlemage with Intel's Windows driver. It stays at 64 on other Intel Windows devices and 0 elsewhere. The switch table reflects the exception, and setting 64 before launch restores the old margin. The B570 result supports the new default for cutouts. Death Mountain Trail still needs verification. The PR's Flags and settings section should record the default change. **Reviewed:** 7c7dfffd4535 against 621dae505750: Read the full diff and both commits, AGENTS.md, CONTRIBUTING.md, the Forgejo template, the agent PR guidance, gpu/vk/device_policy.h and both changed tests. Read the changed switch row and its neighboring entries, the policy initialization and override, the dynamic-state consumer, the fixture runner and the guide source-check path. Skimmed the rest of the switch table, the guide manifest and historical run records. Read the supplied comments and visible review excerpt. The external Tooling repository and linked Lunar Lake branch were unavailable in this checkout. No review-checklist.md was present.; nothing run (a code review). **Checked and fine:** - The runtime patch stays on one topic, follows the existing Intel driver and device-mask convention, and adds no game-derived files, build outputs, generated shaders or third-party changes. - Vulkan's driver and device IDs are populated before policy calculation. The existing startup override still runs before draw recording, and the helper adds no shared writes, allocation, indexing or platform-specific file access. - The compiled PC fixtures catch restoring the old 64-unit Battlemage default. The runner supplies the C++ compiler, and the fixture uses a case-local map for renderer switches. - The existing blend exclusion still protects the Death Mountain Trail haze pass. The change affects eligible non-blended EQUAL draws. **Blocking** (to change before merge) 1. tests/test_device_policy.py:210: The new B570 row works against the supplied base, but current main sets acquire_ahead to true for every driver. Retaining this row as written after merging or rebasing makes the policy test expect off and report on for the B570. Rebase onto current main, include acquire_ahead in the B570 row and preserve main's updated B580 flags when resolving the fixture. 2. tests/test_device_policy.py:427: The new rule checks truncate the float to an integer, as the PC rows also do. If the Battlemage branch returned 0.5f, both would still see 0 while dynamic_state would enable LESS_OR_EQUAL and could bring back the opaque quads. Compare the rule results directly to 0.0f and 64.0f. 3. gpu/vk/device_policy.h:523: The guide manifest lists this header as a reviewed input for settings-graphics.png, including at its moved path on main. The recorded hash already lags the supplied base, and the PR adds another unreviewed change to that input. Review the Graphics guide image and steps on the rebased branch, then record the retain or recapture decision and update the reviewed-source fingerprints. 4. The BeanBot fix-up commit 7c7dfffd has no attribution trailer even though the PR checks that box. A comment records the automation, but the commit history lacks it. Add the applicable AI attribution trailer and carry it into the squash commit. **Waiting on the author** (a run, a measurement or a decision; no edit does it) - gpu/vk/device_policy.h:116: The blanket 0xE2xx exception removes the margin from terrain as well as cutouts. Death Mountain Trail is a known case where strict EQUAL left holes on Intel Windows, and the B570 run skipped the trail. Compare current main and the rebased PR on Windows Battlemage with the override unset, preferably on the still-untested B580. Check the trail ground and the Market cutouts. If the trail develops holes, retain the margin for terrain and narrow the fix. - The measurements table credits the clean picture to B570 and B580 and labels the game baseline as main, although the visual run used only B570 on a release-candidate build with a local renderer patch. Update the PR with the actual commits and builds for each result, list the RX_VK_EQ_BIAS default change, and attach the required same-spot before and after screenshots. Record the comparison runs and their logs so the in-game result can be checked against current main. - The checked test and platform boxes lack results for the merge candidate. The Windows report names one baseline failure in the changed subset, gives only a total for 59 full-suite failures, and includes no Linux result. Run the checks on the rebased head and its base, name the failures that reproduce on both, and record Windows and Linux build or CI results. **Suggestions** (the author may take or leave) - Add an explicit fixture case that sets RX_VK_EQ_BIAS=64 on a Battlemage row and checks the resulting value and override marker. **Testing:** Read-only review. The reported Windows game-free passes predate the fix-up. The B390 and Lunar Lake comments provide useful override comparisons on those devices. The proposed Lunar Lake branch itself has no reported in-game run, and neither comment establishes Battlemage terrain safety. **Overlaps and merge order:** Main already contains the acquire-ahead change from #1574 and the guide move from #1802. Rebase #1801 over both. The Lunar Lake branch in the comments edits the same policy, switch row and tests. If taken forward, rebase it after #1801 and verify its own terrain results. #1631 is already in the base and covers blended haze. --- <sub>Automated code review by BeanBot (gpt-6.2-sol), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
@ -109,0 +113,4 @@
/// discarded them, rendering opaque rectangles (issue #1413); keep it 0 there.
inline float equal_depth_bias(VkDriverId driver, uint32_t device) {
if (driver != VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) return 0.0f;
if ((device & 0xFF00u) == 0xE200u) return 0.0f;
Member

This also removes the margin from terrain. Compare Death Mountain Trail on Windows Battlemage with the override unset before shipping this default.

This also removes the margin from terrain. Compare Death Mountain Trail on Windows Battlemage with the override unset before shipping this default.
@ -510,3 +521,3 @@
p.frag_shuffle_fallback = f.driver_id == VK_DRIVER_ID_AMD_PROPRIETARY;
p.position_invariant = !f.nvidia();
p.equal_depth_bias = f.driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS ? 64.0f : 0.0f;
p.equal_depth_bias = policy_rule::equal_depth_bias(f.driver_id, f.device_id);
Member

The Graphics guide manifest fingerprints this header. Review the image and steps after rebasing and record whether to keep or recapture the image before updating the fingerprints.

The Graphics guide manifest fingerprints this header. Review the image and steps after rebasing and record whether to keep or recapture the image before updating the fingerprints.
@ -355,3 +355,3 @@
SW(RX_VK_DUMP_STEPS, diag, string, "every step dumped", "Narrows a frame dump to the steps lo-hi.")
SW(RX_VK_DUMP_W, diag, int, "320 pixels (16 to 4096)", "Width of the scaled pictures a frame dump writes.")
SW(RX_VK_EQ_BIAS, hw, float, "64 on Intel's Windows driver, 0 (off) elsewhere (Mesa's Intel driver too)", "Sets the margin that turns EQUAL depth tests into LESS_OR_EQUAL with a bias; 0 is as the game asks.")
SW(RX_VK_EQ_BIAS, hw, float, "64 on Intel's Windows driver except Battlemage, 0 (off) elsewhere (Mesa's Intel driver too)", "Sets the margin that turns EQUAL depth tests into LESS_OR_EQUAL with a bias; 0 is as the game asks.")
Member

Nit. Say “discrete Battlemage (0xE2xx)” here to match the rule and make the exception clear to Arc B390 owners.

Nit. Say “discrete Battlemage (0xE2xx)” here to match the rule and make the exception clear to Arc B390 owners.
@ -205,0 +207,4 @@
dict(name="Arc B570, Intel's Windows driver 101.9175",
facts=(0x8086, 0xE20C, "INTEL_PROPRIETARY_WINDOWS", INTEL | 9175, "DISCRETE_GPU", "101.9175", "Intel(R) Arc(TM) B570 Graphics",
1, 0, 10074, 9305, 16311, 12, 12, 6, 1, 1, 1, 0, 0, 1, 1, 32, 32, 0xFF),
on="fetch_bounds networks_left_out gather_offset position_invariant compute_builds_serial pcache_fetch_lock split_before_draw "
Member

After rebasing, add acquire_ahead to this row. Current main enables it for every driver, so this fixture will otherwise fail on the B570.

After rebasing, add acquire_ahead to this row. Current main enables it for every driver, so this fixture will otherwise fail on the B570.
@ -415,2 +424,4 @@
("(long long)policy_rule::native_fadd_listed(VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, 0x7D55, 0xFFFFFFFFu)", 0),
("(long long)policy_rule::native_fadd_listed(VK_DRIVER_ID_AMD_PROPRIETARY, 0x7550, 0xFFFFFFFFu)", 0),
# (equal_depth_bias: 0 on discrete Battlemage 0xE2xx and Mesa ANV; 64 on older/integrated Intel Windows families)
("(long long)policy_rule::equal_depth_bias(VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, 0xE20Cu)", 0),
Member

Check the exact float result. A return of 0.5f truncates to 0 here and in the PC fixtures but still activates LESS_OR_EQUAL in the renderer.

Check the exact float result. A return of 0.5f truncates to 0 here and in the PC fixtures but still activates LESS_OR_EQUAL in the renderer.
@ -32,1 +31,3 @@
raise SystemExit("the margin is not on by default on Intel's Windows driver only")
if "p.equal_depth_bias = policy_rule::equal_depth_bias(f.driver_id, f.device_id);" not in policy:
raise SystemExit("the margin is not computed by policy_rule::equal_depth_bias")
eq_rule = block(policy, "inline float equal_depth_bias(VkDriverId driver, uint32_t device)")
Member

Nit. The compiled fixture can own the rule's behavior. Keep this source check focused on the policy wiring and draw-state guard so an equivalent rewrite of the helper needn't update literal snippets.

Nit. The compiled fixture can own the rule's behavior. Keep this source check focused on the policy wiring and draw-state guard so an equivalent rewrite of the helper needn't update literal snippets.
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
CI / Conventional Commit title (pull_request) Successful in 11s
PR description / Description follows the template (pull_request_target) Failing after 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 18s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 20s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/intel-battlemage-equal-depth-bias:tiktiki-fix/intel-battlemage-equal-depth-bias'
git switch 'tiktiki-fix/intel-battlemage-equal-depth-bias'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
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!1801
No description provided.