fix(vk): Lunar Lake draws the colour passes' EQUAL as the game asks, and its foliage is cut out #2299
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2299
Loading…
Reference in a new issue
No description provided.
Delete branch "twisted89/Longshot:fix/vk-lnl-equal-depth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On Lunar Lake laptops (Intel Arc 140V and the other
0x64xxiGPUs) with Intel's Windows driver, Kokiri Forest's ivy, leaves and grass draw as solid blocky quads instead of their cut-out shapes. It's the same bug #1801 fixed on Battlemage: the game cuts the foliage out in a depth pre-pass, then draws its colour with an EQUAL depth test. Intel's Windows driver gets that test turned into LESS_OR_EQUAL with a 64-unit margin (equal_depth_bias). That margin also passes every fragment in front of the pre-pass. Where the pre-pass cut a leaf away, the trunk behind it holds the depth, and the colour pass draws the whole quad over it.This PR leaves the margin off on Lunar Lake as well:
policy_rule::equal_depth_biasreturns 0 for0x64xxas it does for0xE2xx. The foliage is cut out again, and the ground in Kokiri Forest has no holes, which is what the margin was added for on other Intel GPUs.To see it on main: an Arc 140V on Intel's Windows driver 101.8991, default settings. Go to Kokiri Forest and look at the ivy on the tree roots and the grass.
Where it showed: the frame dump's draw states (
RX_VK_DUMP_KEY=1) have the foliage colour programs (d8e59341cf4f629cfor the ivy,6b4dea601798c255,43ec86f35fd937b9) testingdt1 dw0against a pre-pass that writes with LESS (dw1 dop1). With the margin the dump logs them asdop3, the converted LESS_OR_EQUAL.Read first:
policy_rule::equal_depth_biasingpu/vk/device_policy.h. See #1801, #1413.Testing
Tested: Windows 11 (26300), Intel Arc 140V (Lunar Lake,
0x8086:0x64A0), Core Ultra 7 258V, driver 32.0.101.8991. On main (equal_depth_bias=64) the foliage in Kokiri Forest drew as whole quads. WithRX_VK_EQ_BIAS=0, which sets the value this PR makes the default (the log showsequal_depth_bias=0*), the ivy, leaves and grass are cut out and the ground has no holes. That run had one device lost in a compute dispatch (592079442d7129da) on a build without the native float add (#1793, now merged); it didn't come back in later runs.Checks:
tests/run_all.py --stricton Windows fails the same 90 checks on this branch as on main @753fb5af(817 pass on both; all 90 are this PC's missing tools: clang, Linux-only and gcc fixtures). The game-free test, the Arc 140V row intest_device_policy.pywith a rule edge for0x64A0, fails on main with onlyequal_depth_bias is 64, expected 0(both lines) and passes here; pointing the rule at0x65xxinstead makes it fail again.test_equal_depth_margin,test_switch_tableandtest_doc_anchorspass.scripts/check_guide_screenshots.py --review-sourcesgives the same result as on main, wheresettings-graphics.pngis already flagged fordevice_policy.h(its review record lags main, as noted on #1801).No screenshots: the before and after are the laptop runs described above, not captured (as in #1801).
Still to test:
RX_VK_EQ_BIASset, in Kokiri Forest and on Death Mountain Trail, expecting the foliage cut out, no holes in the ground, andequal_depth_bias=0without a*in the log (by hand).0x64xx) or a newer driver, Windows: Kokiri Forest and Death Mountain Trail, expecting the same (by hand or@Beanstalk).Measurements
Nothing to measure: the change is one device rule's default (a depth test as the game asks it), with no cost to time or memory.
Risks
RX_VK_EQ_BIAS=64brings the margin back, no rebuild of caches needed.longshot_options.inior cache change).Checklist
Ready for review
main; the title is a Conventional Commit.RX_VK_EQ_BIAS=0, the value this branch makes the default; a build of this branch itself is in Still to test.)mise run testpasses (any failure that also fails onmainis named). (tests/run_all.py --strict: the same 90 failures as main, all missing tools on this PC.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def. (RX_VK_EQ_BIAS's default on Lunar Lake; its row names it.)tests/that reads changed source is updated, not weakened. (test_equal_depth_margin.py's comment;test_device_policy.pygains the row.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11 (26300), Intel Arc 140V (Lunar Lake, 0x64A0), driver 101.8991: with RX_VK_EQ_BIAS=0 (the value this PR makes the default) Kokiri Forest's ivy, leaves and grass are cut out and the ground has no holes; on main (64) they draw as whole quads. A build of this branch itself has not run yet.
Possibly related, for context:
WIP: fix(vk): Lunar Lake draws the colour passes' EQUAL as the game asks, and its foliage is cut outto fix(vk): Lunar Lake draws the colour passes' EQUAL as the game asks, and its foliage is cut out@review
Recommendation: Approve. The code is ready: only testing is left. The override run shows the foliage fix on one Arc 140V, but the branch’s default has not been run in the game and the area where the margin previously prevented ground holes remains untested. Recommend approval; not approved on the forge.
Disables the EQUAL-depth margin on Lunar Lake with Intel’s Windows driver, restoring foliage cutouts in the reported Kokiri Forest run. The tradeoff is a possible return of depth-mismatch holes in other areas or on other Lunar Lake drivers.
Nits (1): optional.
gpu/vk/device_policy.h:129: The DevicePolicy field comment still says the Intel Windows default excludes only Battlemage, contradicting the new Lunar Lake exception. (more on the line) Do: Update the field comment near equal_depth_bias to include Lunar Lake and the scope of the reported run.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/device_policy.h:129: The new default removes the margin from every qualifying colour pass on the Lunar Lake family, while only Kokiri Forest on one device and driver has been checked with the equivalent override. (more on the line) Do: Run this branch with RX_VK_EQ_BIAS unset on the Arc 140V in Kokiri Forest and Death Mountain Trail, and check another Lunar Lake device or driver in both areas; record the policy log and results.@fixcan do L2.Checks: Still running: 9 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven for the branch itself. The author reports that main with RX_VK_EQ_BIAS=0 fixes ivy, leaves and grass on an Arc 140V with driver 101.8991, while the default margin draws solid quads; the branch has not yet been run without the override.
Other systems: The rule returns unchanged values for NVIDIA, AMD, Mesa and Intel Windows devices outside 0x64xx. The change affects all qualifying EQUAL colour passes on Lunar Lake, not only foliage; Death Mountain Trail and other Lunar Lake devices or drivers need checking.
Switches: RX_VK_EQ_BIAS remains overrideable; its default changes from 64 to 0 on Intel Windows 0x64xx devices. The switch table is updated. The reported Kokiri Forest run supports 0 on one driver, but its default across the family is not yet established.
Reviewed:
3e7681a945against753fb5af68: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff, commits, changed policy and test sections, and the depth-state and switch paths. Skimmed the remainder of the large changed files; the full vk_draw.cpp and switches.def were not read. docs/review-checklist.md and ../Tooling/AGENTS.md are absent.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run for this review. The author reports the same 90 missing-tool failures on branch and base, and the relevant policy and switch checks passing; CI is still running.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -126,3 +127,3 @@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;if ((device & 0xFF00u) == 0xE200u || (device & 0xFF00u) == 0x6400u) return 0.0f;L1 (should fix): The new default removes the margin from every qualifying colour pass on the Lunar Lake family, while only Kokiri Forest on one device and driver has been checked with the equivalent override.
When: If depth and colour programs differ on Lunar Lake in Death Mountain Trail or on another driver, EQUAL rejects ground fragments and shows holes where the former margin passed them.
Do: Run this branch with RX_VK_EQ_BIAS unset on the Arc 140V in Kokiri Forest and Death Mountain Trail, and check another Lunar Lake device or driver in both areas; record the policy log and results.
L2 (nit): The DevicePolicy field comment still says the Intel Windows default excludes only Battlemage, contradicting the new Lunar Lake exception.
When: A reader inspecting the equal_depth_bias field is told Lunar Lake receives 64 even though this rule returns 0.
Do: Update the field comment near equal_depth_bias to include Lunar Lake and the scope of the reported run.
@fix
3e7681a945ec38c30fb9Recommendation: Approve. The code is ready: only testing is left. The equivalent override fixes foliage on the tested Arc 140V, but the default also affects other Lunar Lake devices and areas where removing the margin could expose ground holes. Runs on the branch and another device or driver are still needed. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
ec38c30fb9. I rebased it ontomain(f6913dd55f). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change disables the EQUAL depth-test margin on Lunar Lake under Intel’s Windows driver, restoring cut-out foliage in the reported Kokiri Forest run. It keeps the existing override available, at the risk of depth holes elsewhere.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/device_policy.h:129: The new default removes the margin from every qualifying colour pass on the Lunar Lake family, while only Kokiri Forest on one device and driver has been checked with the equivalent override. When: If depth and colour programs differ on Lunar Lake in Death Mountain Trail or on another driver, EQUAL rejects ground fragments and shows holes where the former margin passed them. Do: Run this branch with RX_VK_EQ_BIAS unset on the Arc 140V in Kokiri Forest and Death Mountain Trail, and check another Lunar Lake device or driver in both areas; record the policy log and results.Checks: they run again on this head; a failure shows on the pull request.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports that ivy, leaves and grass change from solid quads to cut-outs on an Arc 140V with RX_VK_EQ_BIAS=0, with no ground holes in Kokiri Forest. The branch’s default itself has not yet been run in game.
Other systems: The policy limits the new default to 0x64xx devices using Intel’s proprietary Windows driver. Battlemage and non-Intel-Windows drivers retain their existing defaults; other Lunar Lake drivers and affected game areas remain untested.
Switches: RX_VK_EQ_BIAS changes its default from 64 to 0 on Lunar Lake with Intel’s Windows driver. Zero fixes the reported foliage on the tested device, but its safety across affected areas and drivers remains to be tested; the switch table is updated.
Reviewed:
ec38c30fb9againstf6913dd55f: Read the repository rules, the fix diff, the targeted depth-policy diff and the relevant policy, override, draw and test references. The full base diff also contains earlier changes outside the listed pull request files; those files and the changed code files were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run the project were executed. The author reports the same 90 missing-tool check failures on the branch and base, and a passing policy test on the branch; CI has not run on this head.
Overlaps and merge order: Not established from the available information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
Jer9 referenced this pull request2026-11-23 16:17:47 +00:00