WIP: fix(vk): no EQUAL depth margin for draws that blend (Death Mountain Trail's khaki veil on Intel) #1631
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1631
Loading…
Reference in a new issue
No description provided.
Delete branch "Guep/Longshot:fix/eq-bias-blended-main"
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?
Type: fix · Risk: low · Tested on: Windows 11, Arc 155H iGPU (Intel) · Needs: another Intel GPU on Windows
TL;DR
On Intel GPUs, the entrance of Death Mountain Trail showed a flat khaki veil over the mountain (dark up close) instead of the peaks. A depth margin that Intel gets for the game's "draw only where the depth is equal" passes also applied to a see-through haze sheet, so the whole sheet was drawn over the mountain. This PR keeps the margin only for passes that don't blend. The veil is gone in every run on an Arc 155H, and the ground the margin was made for stays whole.
Breakdown
RX_VK_EQ_BIAS, and passes with blending on as ONE, ZERO (the same as off), which keep the margin.Why
Since the Intel margin came in, Death Mountain Trail's entrance is covered by a flat khaki sheet where the peaks should be, and the screen goes dark near it. A frame dump shows the draw: program 701ae221d88b2908, blending SRC_ALPHA / ONE_MINUS_SRC_ALPHA, depth test EQUAL with no depth write, turned into LESS_OR_EQUAL - 64 by the margin. Smaller margins (2, 8, 24) kept the veil; only 0, or skipping blended draws, removes it. Setting
RX_VK_EQ_BIAS=0also removes it, but takes the margin away from the passes that need it.How to reproduce
Seen on: Windows 11, Intel Arc 155H iGPU (0x7D55), driver 101.9175
Settings and switches: defaults (the game's upscaler at 50%, FSR 3.1 frame generation 2x; the veil shows with any)
Steps: walk from Kakariko to Death Mountain Trail's entrance and look up the path
Expected: the rocky peaks behind the path
Actual: a flat khaki sheet over the mountain (dark when close)
What changed
The margin now looks at the draw's blending: a written colour target with blending on and a factor pair other than ONE, ZERO counts as blending, and those draws keep EQUAL.
dynamic_stateingpu/vk/vk_draw.cpp: ablendscheck over the colour attachments (blend_en, a written target,blend_factornot ONE / ZERO); the margin applies only when!blends.tests/test_equal_depth_margin.pychecks the new condition and the ONE, ZERO case.Measurements
Verdict: fixed: veil gone in 2 of 2 runs at the trail (and none on the rc.7 base), ground intact; no frame-rate change seen.
Hardware: Windows 11 Pro, Arc 155H iGPU (Core Ultra 7 155H), driver 101.9175, 32 GB
Scene: Death Mountain Trail's entrance, Kokiri Forest, Hyrule Field, Market, Kakariko (child); the game's upscaler 50%, FSR 3.1 FG 2x
Method: the same scripted route (teleport, camera turn) with a screenshot every 120 presents; the veil judged on the shots; fixed-view frame times from longshot_log.txt
How to reproduce: the route above with the default switches
Commits: 668aa0d1 is this PR's change on main
c7db6c02, as it was measured; rebased onto mainc507b98cit is3a28da84, the same diff. The numbers still hold there: fromc7db6c02toc507b98c,gpu/vk/vk_draw.cppchanged only the pipeline key and shader preparation, not the EQUAL margin or the blend state it reads (git diff c7db6c02 c507b98c -- gpu/vk/vk_draw.cpp).c7db6c02(margin 64)The same change on v3.0.0-rc.7 (
544229a2): the trail clean, no lit patches in 4 Hyrule Field shots.Flags and settings
None (
RX_VK_EQ_BIASkeeps its meaning and default).Testing
Tested: Windows 11, Arc 155H, driver 101.9175: the route above in the game on
c7db6c02and on v3.0.0-rc.7 with this change (the same diff as this rebased commit);python tests/test_equal_depth_margin.pypasses. A first version (any blending skips the margin) left holes in Kokiri's ground from passes with blending on as ONE, ZERO: this one keeps the margin there.Not tested: other Intel GPUs (Xe, Arc discrete) and Linux (Mesa's Intel driver keeps EQUAL as the game asks: #1586).
Must be tested:
Risks
What could break: a blended EQUAL pass on Intel that needed the margin could flicker or vanish in spots.
Turning it off: revert the commit (or
RX_VK_EQ_BIAS=0takes the margin away everywhere).Compatibility: nothing changes (no cache, save or option change).
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (the 39 tests that fail on this PC (Windows, no Vulkan headers or spirv-val here) fail on mainc507b98ctoo; none new).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.Tested in game: Windows 11, Intel Arc 155H iGPU (0x7D55), driver 101.9175: Death Mountain Trail's entrance clean (peaks visible, no khaki sheet) in 2 of 2 scripted runs on
c7db6c02with this change, 0 of 2 before; Kokiri Forest and the trail's ground with no holes; the same change on v3.0.0-rc.7 clean at the trail with no lit patches in Hyrule Field.Screenshots, Death Mountain Trail's entrance, the same scripted spot (Arc 155H, the game's upscaler 50%, FSR 3.1 FG 2x). First: before, main @
c7db6c02(margin 64): the khaki sheet over the mountain. Second: after, this change onc7db6c02: the peaks.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.