fix(vk): the blend check of #1631 reads dynamic_state's program, so the renderer compiles again #1659

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/equal-margin-compile into main 2026-11-18 21:54:46 +00:00
Owner

Type: fix · Risk: low · Tested on: Linux (Ryzen 9 7900X, RTX 3090), the renderer compiled and linked · Needs: nothing more

TL;DR

main has not compiled the Vulkan back end since #1631: its blend check names cur_program, which dynamic_state doesn't have. Every release run since stops in the AppImage job (vk_draw.cpp:5438: use of undeclared identifier 'cur_program'), so there is no nightly and no release. The program is dynamic_state's parameter p; this reads it.

Breakdown

  • Who it helps: everyone: nightlies and releases build again.
  • What was wrong: #1631's line (!cur_program || target_write_mask(*cur_program, s, i)) refers to a variable that is not in scope in dynamic_state (it compiled on its branch, not after merging).
  • What changes: target_write_mask(p, s, i), the program dynamic_state is given. p is a reference, so the null check goes.
  • What does not change: #1631's rule: a draw that blends gets no EQUAL depth margin; a target the program does not write does not count as blending.
  • How it was checked: the renderer compiled and linked (dev_build.py vk, 214 files, 0 failed).
  • Risk: low: one expression, the same meaning #1631 intended.

Why

Release run 38286 (the v3.0.0 tag on a7621bd7) failed in its appimage job:

gpu/vk/vk_draw.cpp:5438:77: error: use of undeclared identifier 'cur_program'
gpu/vk/vk_draw.cpp:5438:111: error: use of undeclared identifier 'cur_program'
FAILED vk_draw.cpp

main at 10de79fb has the same line.

What changed

  • gpu/vk/vk_draw.cpp dynamic_state: the blend check reads target_write_mask(p, s, i).

Measurements

Nothing to measure: a compile fix, the same behaviour #1631 describes.

Testing

Tested: Linux, the Vulkan back end built from this branch with the build tools of tools.lock (python -I scripts/dev_build.py vk): compiled in 170 s, 0 failed, longshot_vk.so linked and its symbols checked.

Not tested: a run in the game and tests/run_all.py: no game runs or tests on this PC; tests/test_equal_depth_margin.py reads this function and is left to CI. Opened without a game run at the maintainer's request, to unblock the nightlies.

Must be tested: Intel, Death Mountain Trail's entrance: no khaki veil and no holes in the ground (#1631's own check), on the next nightly.

Risks

What could break: nothing beyond #1631's own change; this makes it compile.

Turning it off: RX_VK_EQ_BIAS=0, as before.

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.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Linux (Ryzen 9 7900X, RTX 3090), the renderer compiled and linked · **Needs:** nothing more ## TL;DR `main` has not compiled the Vulkan back end since #1631: its blend check names `cur_program`, which `dynamic_state` doesn't have. Every release run since stops in the AppImage job (`vk_draw.cpp:5438: use of undeclared identifier 'cur_program'`), so there is no nightly and no release. The program is `dynamic_state`'s parameter `p`; this reads it. ## Breakdown - **Who it helps:** everyone: nightlies and releases build again. - **What was wrong:** #1631's line `(!cur_program || target_write_mask(*cur_program, s, i))` refers to a variable that is not in scope in `dynamic_state` (it compiled on its branch, not after merging). - **What changes:** `target_write_mask(p, s, i)`, the program `dynamic_state` is given. `p` is a reference, so the null check goes. - **What does not change:** #1631's rule: a draw that blends gets no EQUAL depth margin; a target the program does not write does not count as blending. - **How it was checked:** the renderer compiled and linked (`dev_build.py vk`, 214 files, 0 failed). - **Risk:** low: one expression, the same meaning #1631 intended. ## Why Release run [38286](https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/38286) (the v3.0.0 tag on `a7621bd7`) failed in its appimage job: ``` gpu/vk/vk_draw.cpp:5438:77: error: use of undeclared identifier 'cur_program' gpu/vk/vk_draw.cpp:5438:111: error: use of undeclared identifier 'cur_program' FAILED vk_draw.cpp ``` `main` at `10de79fb` has the same line. ## What changed - `gpu/vk/vk_draw.cpp` `dynamic_state`: the blend check reads `target_write_mask(p, s, i)`. ## Measurements Nothing to measure: a compile fix, the same behaviour #1631 describes. ## Testing **Tested:** Linux, the Vulkan back end built from this branch with the build tools of tools.lock (`python -I scripts/dev_build.py vk`): compiled in 170 s, 0 failed, `longshot_vk.so` linked and its symbols checked. **Not tested:** a run in the game and `tests/run_all.py`: no game runs or tests on this PC; `tests/test_equal_depth_margin.py` reads this function and is left to CI. Opened without a game run at the maintainer's request, to unblock the nightlies. **Must be tested:** Intel, Death Mountain Trail's entrance: no khaki veil and no holes in the ground (#1631's own check), on the next nightly. ## Risks **What could break:** nothing beyond #1631's own change; this makes it compile. **Turning it off:** `RX_VK_EQ_BIAS=0`, as before. ## 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). - [ ] 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`. - [ ] `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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(vk): the blend check of #1631 reads dynamic_state's program, so the renderer compiles again
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 8s
PR description / Description follows the template (pull_request_target) Failing after 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 15s
2996dc5887
The EQUAL depth margin's blend check (#1631) named cur_program, which
dynamic_state does not have: the program is its parameter p. main has not
compiled the Vulkan back end since, and the release run of the AppImage
stops at vk_draw.cpp:5438 (use of undeclared identifier 'cur_program').
p is a reference, so the null check goes with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/equal-margin-compile 2026-11-18 21:54:46 +00:00
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!1659
No description provided.