perf(vk): defaults of its own for Mesa's Intel driver, 8.3 to 18.2 fps on an Iris Xe #1586
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!1586
Loading…
Reference in a new issue
No description provided.
Delete branch "Tomiss/Longshot:perf/intel-xe-mesh-fallback"
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: perf · Risk: medium · Tested on: Linux (Bazzite), Intel Iris Xe, Mesa 26.2.7 · Needs: Linux, another Mesa Intel GPU (Arc or Xe); Windows, Intel
TL;DR
On Intel GPUs under Linux (Mesa's Intel driver) the game ran at a slideshow and drew a green wall over the rocks on
Death Mountain Trail, because the renderer gave that driver defaults made for other GPUs and drivers. This PR gives
Mesa's Intel driver defaults of its own: a mesh fallback built for its hardware, and the game's own depth test. On an
Iris Xe on Death Mountain Trail the game went from 8.3 to 18.2 fps against main, and the rocks are drawn; game-free
checks cover each change.
Breakdown
and starved for workgroup memory on its hardware, and a depth margin meant for Intel's Windows driver.
in device memory and runs its warp at 8 lanes, and the game's EQUAL depth test is kept as the game asks.
as before; every new default has a switch.
three interleaved rounds, and the green wall gone.
broken geometry on Mesa's Intel driver only; each default has a switch.
Why
On an Iris Xe under Linux the game is barely playable: about 8 fps on Death Mountain Trail, and a flat sage-green wall
with vertical streaks stands over the canyon's rocks there. Both come from defaults that don't suit Mesa's Intel driver.
The Iris Xe has no mesh shaders, so the game's mesh programs run as compute stages (the mesh fallback), which were 70%
of the frame at Hyrule Castle. On this hardware they spilled: every guest global load searched the program's storage
buffers inline; each mesh workgroup kept 8-17 KB of attributes in workgroup memory, which Intel hands out in 16 or 32 KB
steps, so few workgroups ran at once; and any stage with a ballot, vote or shuffle was held to 32 lanes, where a lane
gets the fewest registers.
The renderer also gave every Intel GPU the equal-depth margin made for Intel's Windows driver (#17, an Arc B390). It
turns the game's EQUAL depth test into LESS_OR_EQUAL with a bias, which lets terrain draw over the canyon's rock where
the depth pass drew none. Mesa's compiler keeps EQUAL exact, so it needs no margin.
See #17.
How to reproduce
Seen on: Linux (Bazzite, kernel 7.3.4), Intel Iris Xe (RPL-P), Mesa 26.2.7
Settings and switches: defaults
Steps: load a save on Death Mountain Trail, the Kakariko side, and look up the canyon
Expected: the canyon's rocks, at a playable frame rate
Actual: about 8 fps, and a green streaked wall over the rocks
What changed
Mesa's Intel driver gets defaults of its own in the renderer's device policy and the shader translator: the mesh
fallback's stages built for its hardware, and no equal-depth margin. Each is in the translator stamp where it changes
the SPIR-V, and has a switch.
define_loadinspirv_emit_context.cppreads a task/mesh fallback stage's global loadsthrough the guest page table, branch-free (
RX_VK_MESH_PAGES); stores and atomics keep the search.LoadAttribute/StoreAttributeaccessors inemit_spirv_mesh.cpp; the pool and its header clear invk_draw.cpp, before thedraw's stages with a barrier between) (
RX_VK_MESH_GLOBAL_ATTRS).emit_spirv_warp.cpp(PlanSharedWarpand the shared ballot/vote/shuffle sites) keeps afallback stage's warp in workgroup memory;
gpu/vk/fallback_lanes.hrecognises such a stage from its SPIR-V and therenderer runs it at
RX_VK_MESH_LANES(8) (RX_VK_MESH_SHARED_WARP,RX_VK_MESH_SHARED_WARP_CHECKfor developers).LoadAttribute(main's #906 made Soa the default); thestamp bits of the four switches sit clear of the software multiplies' form.
equal_depth_biasingpu/vk/device_policy.hdefaults to 64 forVK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWSonly, 0 elsewhere (RX_VK_EQ_BIASstill sets it on any GPU).test_mesh_fallback_pages.py,test_mesh_fallback_global_attrs.py,test_mesh_fallback_shared_warp.py,test_fallback_lanes.py/.cpp, and the device policy check's ANV PC expecting no margin.Measurements
Verdict: it helps: 8.3 -> 18.2 fps (+119%) on an Iris Xe on Death Mountain Trail against main, in three interleaved rounds, at a lower GPU clock; the picture the same.
Hardware: Bazzite (Fedora 45, kernel 7.3.4), Intel Iris Xe Graphics (RPL-P, integrated), Mesa 26.2.7 ANV (no mesh shaders), Intel Core i9-13900H, 32 GB
Scene: Death Mountain Trail above Kakariko, from a save, standing still; headless (offscreen 1920x1080), my options file (Custom, handheld profile, upscaler off, no frame rate cap)
Method: one base at main
7daafa7a(scripts/dev_build.py base), this PR's renderer as a pack over it, and the base alone; shaders compiled in play (RX_VK_PRECOMPILE=0); three interleaved rounds (main, then this PR), each ajob_queue.py --mode timingjob, the first round a warm-up; 90 s standing after the load, the median of the last eightpresents, N fpsreports of each run; GPU clock and power-limit flag logged each second from sysfsHow to reproduce: the two runtimes from
scripts/dev_build.py rtandrt --empty, a save on Death Mountain Trail,HOS_HEADLESS=1 RX_VK_PRECOMPILE=0, stand still 90 sMeasured before the rebase onto main
430eef4f(no conflict):c3c9b0eeis this PR's994e6647. The numbers hold on430eef4f: #1567 changes only which compute pipelines the shader preparation warms (prepare_run,precompile_warm,computes_planinvk_draw.cpp), and these runs had no preparation (RX_VK_PRECOMPILE=0); on Mesa's Intel driver its default was already the listed computes.7daafa7ac3c9b0eeThe run file:
docs/tested/2026-11-18-intel-xe-mesh-fallback-thomas-montano-run01.md. Earlier, per part, at Hyrule Castle on the same PC (commit messages,docs/tested/2026-11-14-*): the page table 8.4 -> 11.5 fps; the attribute pool ~9.9 -> ~11.7 fps; the shared warp at 8 lanes +26% against it off.Screenshots (the same spot, the same present count):
Flags and settings
Five new switches, all on by default on Mesa's Intel driver only, and one default changed.
RX_VK_MESH_PAGESRX_VK_MESH_GLOBAL_ATTRSRX_VK_MESH_SHARED_WARPRX_VK_MESH_LANESRX_VK_MESH_SHARED_WARP_CHECKRX_VK_EQ_BIASTesting
Tested: on this PC (Bazzite, kernel 7.3.4, Iris Xe, Mesa 26.2.7), this PR's renderer at
c3c9b0eeon a base at main7daafa7a:equal_depth_bias=64in the policy line); with this PR it is gone and the rocks are drawn (equal_depth_bias=0).430eef4f,run_all.py --changed: 219 passed, 18 failed, all 18 among the failures below that fail on main too.python -I -B tests/run_all.py: 680 passed, 54 failed, 50 skipped. 53 of the 54 fail on main7daafa7atoo, rerun there one by one (among themtest_switch_table, for main'sHOS_NFP_*,HOS_SWITCH2*,HOS_VSYNC_YIELD,LONGSHOT_NFC_DIR,RX_VK_INVALIDATE_*; none of this PR's switches). The 54th,test_link_skip, failed under the full run's load (two real-link cases) and passes alone here and on main; this PR changes no build script.Not tested: other Mesa Intel GPUs (Arc, other Xe generations) and Intel's Windows driver: I have only this Iris Xe
under Linux. Other drivers take none of the new paths (their SPIR-V and stamps are as on main, checked by the tests).
Must be tested:
expecting no broken or missing geometry and fps at or above main's (@Beanstalk Linux Intel Arc on Mesa: Hyrule Castle and Kakariko, screenshots and fps against main).
(the margin is unchanged there).
Risks
What could break: on Mesa's Intel driver only: a shared-warp answer that differs from the subgroup's would show as
broken or missing geometry; a pool slot wait that gives up is counted and logged. The depth margin's change could bring
back holes in the ground on a Mesa Intel GPU where EQUAL doesn't hold.
Turning it off:
RX_VK_MESH_PAGES=0,RX_VK_MESH_GLOBAL_ATTRS=0,RX_VK_MESH_SHARED_WARP=0,RX_VK_EQ_BIAS=64.Compatibility:
MKWVK_API_VERSIONunchanged; nothing else changes for a player.Issues
See #17
Related open PRs that touch the mesh fallback: #1556 (where stages are pinned to 32 lanes), #1531 and #1561 (the fallback's record layout).
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). — 53 fail on main too (Testing);test_link_skipflaked under load and passes alone.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md).mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Tested in game: Iris Xe, Mesa 26.2.7, Bazzite (kernel 7.3.4): Death Mountain Trail, the green wall over the canyon gone (it is on main) and the rocks drawn; above Kakariko 8.3 -> 18.2 fps against main
7daafa7aover three interleaved rounds, the picture the samePossibly related, for context:
WIP: perf(vk): the mesh fallback twice as fast on Mesa's Intel driver, and no equal-depth margin thereto WIP: perf(vk): defaults of its own for Mesa's Intel driver, 8.3 to 18.2 fps on an Iris Xed5926ccb1e807b29ebc2WIP: perf(vk): defaults of its own for Mesa's Intel driver, 8.3 to 18.2 fps on an Iris Xeto perf(vk): defaults of its own for Mesa's Intel driver, 8.3 to 18.2 fps on an Iris XeRebased onto main
430eef4f(#1567, no conflict) and force-pushed;run_all.py --changed219 passed, 18 failed, the 18 failing on main too. The numbers measured on7daafa7ahold: #1567 changes only the shader preparation's compute warming, which these runs didn't use. Retitled as one change: Mesa's Intel driver gets defaults of its own.@Beanstalk Linux, an Intel Arc or Xe GPU on Mesa: Hyrule Castle and Death Mountain Trail standing still, screenshots and fps against main. Windows, an Intel GPU: the ground at the Death Mountain gate and in Kakariko, expecting no holes.
@Tomiss only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.