perf(vk): +35.5% Courtyard FPS (17.2 to 23.3 fps) on Intel Iris Xe (Mesa ANV), fix ANV PointCoord sky blowout & 16 GB UMA DMA-BUF leaks #2515
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2515
Loading…
Reference in a new issue
No description provided.
Delete branch "greenwafflezz/Longshot:pr/iris-xe-mesa-anv"
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
See #1897, See #2487.
This PR brings the complete end-to-end Intel Iris Xe / Gen12 (Linux Mesa ANV 26.2.4, 16 GB UMA) enablement, visual correctness, stability, and performance campaign — taking Longshot from an unplayable
~9 FPSupstream baseline with black/rainbow corruption, GPU hangs, and OOM crashes to23.3 Base FPS/46+ Displayed FPSin Courtyard (+35.5%overupstream/main @ 209389fa), clean visuals across every tested area, and responsive low-latency 3D-MV FrameGen. All Intel-specific heuristics are scoped toVK_DRIVER_ID_INTEL_OPEN_SOURCE_MESAor runtime switches ingpu/vk/switches.defso NVIDIA and AMD behavior is preserved.Across the full campaign (
Batches 1–15+ rebase ontomain @ be663a08, headdd991ac7), this branch resolves all six layers of blockers encountered on Gen12 / Xe-LP integrated GPUs:Playability, GPU Hang & Black/Rainbow Corruption Fixes (Baseline
~9 FPS→ Clean Playable):gpu/vk/eden/): Implemented 1-barrier ping-pong SIMD8-assistedwg_warp32, linearized divergent subgroupIfs, fixedOp::ConditionRefand trivial self-Phi uniformity, addedEliminateUniformWarpOps, nativeREDUX_nx2/R2UR_nx2, andDerivativeGroupLinearKHR(~3×faster subgroup ops on Mesh/Task/Compute).BDA → SSBOlowering & Gen12 register pressure (RX_VK_BDA_SSBO=1,RX_VK_MINREG_SCHED,RX_VK_COALESCE_GUARD): Eliminated Linux i915 10 s GPU hangs (VK_ERROR_DEVICE_LOST) caused by heavy clustered-light Fragment and Compute shaders executing hundreds of software guest page-table walks; paired with live-range minimization and256 KB/ SESE coalescing to slashspills:fillsin 128-GRF Gen12 shaders.RX_VK_PRECOMPILE=0): Fixed index-onlypipeline_cache_play()and load-at-create so warm areas run with0skipped draws (140 → 0skipped in Courtyard vs upstream) and no missing-floor white blowout.Visual Artifacts Eliminated Across Every Scene (Desktop → Clean 1080p):
3DSTATE_SBEPointCoordsky/sun blowout: Mesa ANV leaksPointSpriteTextureCoordinateEnable = 1onto subsequent pipelines in the sameVkCommandBufferafter anyBuiltIn PointCoorddraw (e.g., simulated-turf shadow), overwritingLocation 0withPointCoord.x = 0.5on laterPOINT_LISTdraws — accumulating OoT's 1×1 sun visibility pass (edd4d7c51103645d) toG=12.5and washing out the screen yellow-white. Fixed with zero shader-cache invalidation by trackingPointCoorddraws per command buffer on Mesa ANV and callingsplit_part_forced()before a different program'sNVN_DRAW_PRIMITIVE_POINTSdraw (G: 12.5 → 1.015).equal_depth_bias = 64.0fon opaqueEQUALdraws (fixing shimmering hills under FSR 3.1 jitter) while disabling it on alpha-tested/blended draws (eliminating black hair-card and foliage fringes on Link and bushes).fng6) & Gen12 neon spill blocks: Mapped bothNaNand±Infto0.0finFragColor/OpImageWrite(preventing+65000.0finterior prop blowout in Link's House) and droppedshader_spilling_rate=2(4×2neon blocks on PBR shaders) back to Mesa default.Bandwidth, Compression, Barriers & Compute Efficiency (96 EUs, Shared LPDDR4x UMA):
CCS_Elossless compression & fast clears: Added explicitVkImageFormatListCreateInfo(RX_VK_FMT_LIST) onMUTABLE_FORMATrender targets to keep Gen12CCS_Ecompression active (-15–25%bandwidth) + fused hardwareVK_ATTACHMENT_LOAD_OP_CLEAR.RX_VK_MFB_BATCH) with lossless backface/frustum/degenerate culling (RX_VK_MFB_CULL), narrowed internalfallback_record()and compute dispatch barriers (VERTEX_INPUT_BIT,-40full barriers/frame,-14.7%m fallback), skippedsim_turfmirror copies whentarget <= stock(-15 MBVRAM,-13.7 MB/frame), added 32-bit guest page-table lookup (gp35,-9.9%m dispatch), fixedModuleProgrammesh module keys, enabledbc_small_runson Mesa ANV, and added custom Gen12SIMD16SPIR-V overrides (ab7699ee,48590e0b,e40dc98f,26fe0c701.57 → 0.82 ms).FP16 FSR 3.1 + Artifact-Free 3D-MV FrameGen + Low Latency + Focus-Loss Crash Fixes:
SIMD16,0:0spills), fused perceptual-to-linearP_ACCUMULATE_SQ(kSquareOutput, removingdlss_out.compand saving33.2 MB/frame), and replaced SLM-loop RCAS with 5-tap L1 FP16texelFetch(12,066 → 2,148Gen12 cycles,5.6×fewer).Auto/2x/3x): BecauseFSR 3.1 FIrequiresshaderStorageImageReadWithoutFormat(unsupported on Gen12), upgraded the built-in compute FrameGen (~7.0 ms → ~0.70 ms,~10×faster) to use exact 3D camera + skinned-actor MVs + depth (even withdlss=0), trajectory-consistency gating + safenearfallback (eliminating Link/shield/shadow shredding and camera-pan shearing), exact pre/post-HUD masking (fg_copy_hud), focus-loss hang fixes (texture-eviction UAF +ahead=1ring cap saving-50 msinput lag), and dead-air pacing convergence (72/74bursts<2 ms→0 late,0 <12 ms).16 GB Unified-Memory (UMA) OOM Crash & VRAM Reduction (
-1.04 GiB):system_heap_usage()(gpu/vk/vk_vma.cpp) soimports_give_back()and Linux memory pressure unpin retired DMA-BUF imports (~1.1–1.5 GBactive,0retired leaked, preventing OOM crashes seconds into gameplay).FallbackBufferspool underreplay_mu+ cappedsmall_vram_textures(<=16 GBiGPU) toMFB_BATCH=2, cuttingother buffersfrom1,562 MB(2-threadTLS_OBJECTduplication) to493–519 MB(-1.04 GiB, zero swap thrashing).Host CPU & Submission (
host/nvdrv.c,host/rx_backend.c,gpu/vk/vk_replay.cpp):RX_VK_CHUNK=720, TLSstage_handles/HandleFastcaches, disabled Windows Arc B580ub_everyworkaround on ANV (-30%pushed descriptors), burst-scopedreplay_mu, AVX2 dirty-page collection (collect_in), and256 KBadaptive dirty-range merging.Key files to review first:
gpu/vk/vk_draw.h,gpu/vk/vk_draw.cpp,gpu/vk/vk_replay.cpp— Mesa ANV3DSTATE_SBEPointCoordtracking +split_part_forced(), sharedFallbackBufferspool, narrowed MFB/compute barriers,ahead=1FrameGen queue, replay fast paths.gpu/vk/vk_vma.cpp— single-heap iGPU accounting insystem_heap_usage().gpu/vk/device_policy.h,gpu/vk/vk_texture.cpp,gpu/vk/switches.def—bc_small_runs,CCS_Eformat lists,LOAD_OP_CLEARfusion,MFB_BATCH=2cap onsmall_vram_textures, narrowed compute barriers.gpu/vk/vk_fsr3.cpp,gpu/vk/vk_temporal.cpp,gpu/vk/vk_framegen.cpp,gpu/vk/shaders/fg_*— FP16 FSR 3.1 + fusedP_ACCUMULATE_SQ, 5-tap L1 FP16 RCAS, universal 3D-MV FrameGen & pacing.gpu/vk/eden/shader_recompiler/—wg_warp32(wg_warp_plan.h),BDA → SSBOlowering,MINREG_SCHED/COALESCE_GUARD,fng6±Inf/NaNguard,gp3532-bit page-table math, andvk_custom_spv.h.Live 1080p Gameplay Showcase on Intel Iris Xe
Recorded live on Intel Core i5-1235U / Iris Xe 96 EUs (26W PL1, 16 GB LPDDR4x UMA, EndeavourOS Linux Wayland, Mesa ANV 26.2.4) at
1920×1080with integrated 2× 3D-MV FrameGen via zero-copy VAAPI (wf-recorder -c h264_vaapi -d /dev/dri/renderD128 -p qp=20):~9 FPS, black/rainbow corruption + hangs)23.3 Base / 46+ FG FPS, Kokiri Forest)~13 FPS, blocky + white/neon artifacts)Hyrule Castle Path)Testing
Tested: EndeavourOS Linux (Wayland / Niri), Intel Core i5-1235U / Iris Xe (Alder Lake GT2, Gen12 / Xe-LP, 96 EUs, 26W PL1, 16 GB LPDDR4x UMA), Mesa ANV 26.2.4,
1920×1080 @ 60 Hz(vsync=2MAILBOX). Played and recorded live across 5 areas (Hyrule Market, Kakariko Village, Hyrule Field, Kokiri Forest, Zora's Domain) — zero crashes, zero GPU hangs (including multi-workspace focus-loss stress tests), zero sky blowout during 360° camera pans, zero interior bloom spikes, zero hair-card fringes, clean synthesized_madeFrameGen frames, and steady DMA-BUF imports (~1.1–1.5 GB,0retired still imported). Confirmed the Mesa ANV3DSTATE_SBEPointCoordleak via standalone Vulkan repro +INTEL_DEBUG=batand verified across a 360° Kakariko sky sweep (edd4d7c51103645dmean12.5 → 1.015, step-10 RGB mean[241.4, 232.9, 210.0] → [118.3, 116.0, 163.9],0shader-cache invalidation,0.0 msadded waits). Checks passed on Linux release build (RX_RELEASE=1 LONGSHOT_FSR=1):test_pass_barrier,test_mesh_fallback_global_attrs,test_mesh_fallback_shared_warp,test_present_thread,test_linux_pressure,test_device_policy,test_pcache_load,test_vendor_translation,test_vendor_fixes,test_astc_decoder_gpu.py --gpu,test_fallback_buffer_cleanup.py,test_mesh_fallback_capacity.py,test_quick_pipelines.py,test_vram_held_idle.py,spirv-val --target-env vulkan1.2, andINTEL_DEBUG=csISA audit (SIMD16,0:0spills).Still to test:
llvm-mingwbuild and runtime behavior where Mesa-only guards are bypassed (@Beanstalk Windows Intel / by hand)wg_warp32/ recompiler passes,BDA → SSBO+MINREG_SCHED,CCS_E+ narrowed barriers, FP16 FSR 3.1 + RCAS, 3D-MV FrameGen + pacer, ANV3DSTATE_SBEPointCoordfix, single-heap iGPU UMAsystem_heap_usage()fix) if requested by maintainers (by hand)Measurements
Verdict:
2.6×throughput overall vs initial unoptimized upstream (~9 FPSunplayable →23.3 Base FPS/46+ FG FPS,+35.5%vs rebasedupstream/main @ 209389fa17.2 fps,+12.0%vsv1.0-iris-xe20.8 fps),-18.3%worst-case frame time in Kakariko (107.9 → 88.2 ms),-1.04 GiBfallback buffer VRAM (1,562 → 493–519 MB),0retired DMA-BUF imports leaked,-50 msFrameGen queue latency (ahead=1), and 100% elimination of black/rainbow corruption, GPU hangs, hair fringes, interior white bloom, and Mesa ANV3DSTATE_SBEsky blowout (edd4d7c51103645d:12.5 → 1.015).Setup: Intel Core i5-1235U / Iris Xe 96 EUs (26W), 16 GB LPDDR4x UMA, EndeavourOS Linux, Mesa ANV 26.2.4,
1440×810 → 1080p(unprofiled 3-way, FSR 3.1, FG Off, uncapped,PASS_TIMING=0) and1787×1005 → 1920×1080(pass breakdown & progression).dd991ac7is a conflict-free rebase of measured79beef54ontomain @ be663a08(resolving only 1 comment line ingpu/vk/vk_shader.cpp).209389fadd991ac7slot_01) Steady Base FPS17.2 fps23.3 fps+35.5%(+12.0%vsv1.0-iris-xe20.8 fps)113.7 ms(13.8 s stall)86.9 ms-23.6%518.3406.4-111.9(-21.6%)140(black 3D)0-140other buffersVRAM (16 GB UMA)1,562 MB(2-thread TLS dup)493–519 MB-1.04 GiB(-67%)~1.1–1.5 GB(0retired)edd4d7c51103645dMean12.5(yellow-white wash)1.015(step 10 RGB118,116,164)0cache inv.)2. Full Campaign Progression (
~9 FPSBroken Baseline →v1.0-iris-xe→ Rebaseddd991ac7)nightly-469-9af4808f)~9~9>110 msBatch 5–10)~13~13–24~75 ms4×2neon spill blocks, hair fringes, white bloom,72/74FG bursts<2 msv1.0-iris-xe(Batch 15,85b282c5)20.56(20.8Courtyard)41.1(Auto/2x)41.8–42.8 ms35.1 msAuto handover (0 late),-50 msinput queuedd991ac7)23.3(Courtyard) /17.3(Kakariko)46+(Courtyard 2x)34.5 ms(Courtyard)+35.5%vs209389fa(17.2 fps),-1.04 GiBother buffers,0DMA-BUF leaks, clean sky/sun (PointCoordfix) &±Inffix (fng6)3. Per-Pass GPU Breakdown (
RX_VK_PASS_TIMING=2,1787×1005 → 1920×1080)7984161db3e053b5/mfb_task(28dd2baa)3.19 ms/2.35 ms0.57 ms/0.97 mswg_warp32+ uniformity fixes (5.6×/11.2×ISA)fsr3 accumulate+dlss_out.comp3.60 ms+~1.00 ms2.18 ms(dlss_outremoved)uvec2SLM +kSquareOutput(SIMD16,0:0spills,-33.2 MB/frame)fsr3 prepare_reactivity/inputs/luma1.50/1.00/0.86 ms0.96/0.83/0.69 ms-36%/-17%/-20%(SIMD16,0:0spills)fg_rcas.comp(2×–4×/frame @ 1080p)12,066 cyc(SLM + barrier)2,148 cyc5.6×fewer cycles (5-tap L1 FP16texelFetch)26fe0c70ab9fc547/48590e0b8589d6caCS1.57 ms/1.20 ms0.82 ms/0.85 msSIMD16,0:0spills)3de6d86ec7e6720e(sim_turf)0.946 ms<0.33 mstarget <= stock(-15 MBVRAM,-13.7 MB/frame)m fallback/m dispatch-14.7%/-9.9%fallback_record()barriers (-40/frame) +RX_VK_GP_FAST32fg_copy_hud+fg_synth2_mv)~7.0 ms(optical flow)~0.70 ms~10×faster,ahead=1(-50 msinput queue)Switches Added / Tuned (Shipped Defaults & Rationale)
All vendor defaults apply only when
VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESAis detected (preserving stock behavior on NVIDIA/AMD); debug/bisect switches ship off (0):RX_VK_BDA_SSBO(default1on Mesa Intel: prevents i915 hangs & cuts register spills),RX_VK_CUSTOM_SPV(default1on Mesa Intel:26fe0c701.57 → 0.82 ms,48590e0b/e40dc98fSIMD16),RX_VK_GP_FAST32(default1:-9.9%m dispatch),RX_VK_MFB_BATCH(default4, capped to2onsmall_vram_textures<=16 GBiGPU:-1.04 GiBother buffers),RX_VK_MFB_CULL(default1on fallback: lossless backface/frustum/degenerate cull),RX_VK_MESH_WG_WARP(default1on Gen12 fallback: SIMD8-assisted warp-32),RX_VK_FMT_LIST(default1: preservesCCS_Ecompression),RX_VK_COALESCE_GUARD/RX_VK_MINREG_SCHED(default1on Mesa Intel: avoids giant-block register spills),RX_VK_FG_CONSERVE(default1: conservation-law FrameGen pacer,0 late),HOS_RANGE_GAP_KB(default256: adaptive dirty-range merging).0/ stock):RX_VK_BARRIER_DEDUPE_OFF,RX_VK_BARRIER_EVERY_DRAW,RX_VK_COMPUTE_PIN,RX_VK_DISP_FULL_BARRIER,RX_VK_DUMP_ALL_SPV,RX_VK_FAST_MATH,RX_VK_FG_NO_MV,RX_VK_FRAME_OVERLAP,RX_VK_LOOP_SAFETY,RX_VK_MESH_ARGS,RX_VK_MESH_LANES,RX_VK_MFB_FULL_BARRIER,RX_VK_NOOPT,RX_VK_NO_CONTRACTION,RX_VK_NO_CUSTOM_SHADERS,RX_VK_NO_DIRECT_GM_STORES,RX_VK_NO_LOAD_OP_CLEAR,RX_VK_NO_MESH,RX_VK_NO_NATIVE_WARP_OPS,RX_VK_READBACK_EARLY_GAP,RX_VK_REPLAY_PIN_MASK,RX_VK_SKIP_CODE,RX_VK_SKIP_PROG,RX_VK_TRACE_TEX,RX_VK_UB_PUSH_EVERY,RX_VK_WAIT_GPU(all default off so production paths remain unchanged unless explicitly overridden for bisecting or debugging).Risks
main @ be663a08). If maintainers prefer smaller topic-scoped PRs perCONTRIBUTING.md, individual pillars — especially the standalone Mesa ANV3DSTATE_SBEPointCoordfix (vk_draw.h/vk_draw.cpp/vk_replay.cpp), the single-heap iGPUsystem_heap_usage()fix (vk_vma.cpp), and individual SPIR-V/FSR3/FrameGen passes — are cleanly isolated indd991ac7and trivial to cherry-pick.fng6andgp35update SPIR-V translation stamps relative to stockmain; players upgrading an existing shader cache will re-translate shaders once on first boot. (The ANV3DSTATE_SBEfix itself causes zero cache invalidation.)VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESAor gated behind switches ingpu/vk/switches.def; reverting or toggling switches restores stock behavior with zero impact on saves orlongshot_options.ini.Checklist
Ready for review
main; the title is a Conventional Commit. (Intel Iris Xe / Mesa ANV umbrella rebased ontobe663a08; can be split per maintainer preference.)mise run testpasses (any failure that also fails onmainis named). (Verified Linux unit & GPU suite ondd991ac7; see Testing.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.llvm-mingwnoted in Still to test.)mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Possibly related, for context:
d476de6583dd991ac728perf(vk): Intel Iris Xe / Gen12 (Mesa ANV) optimizations, ANV PointCoord SBE fix, iGPU UMA accounting, FP16 FSR 3.1 & 3D-MV FrameGento perf(vk): +35.5% Courtyard FPS (17.2 to 23.3 fps) on Intel Iris Xe (Mesa ANV), fix ANV PointCoord sky blowout & 16 GB UMA DMA-BUF leaksAmazing work! We'll get to reviewing this. Could you maybe split this in a few PR since it's very big?
Data for the "Tier 1 NVIDIA: verify zero regression on default non-Intel paths" item, from a GPU without mesh shaders, where every task/mesh draw goes through the compute fallback: how this PR's mesh-fallback ideas behave there.
Setup: Windows 11 23H2 (22631), NVIDIA GeForce GTX 1070 (Pascal, no mesh shaders:
mesh shaders not offered by the driver: ... the compute path), driver 582.78 (0x91938000), i7-9700K, 32 GB, 1920x1080, default options, Compile shaders: All.What I measured: not this branch (it targets ANV and touches far more), but its mesh-fallback pieces on
main @ 22d0d200, in one build:fallback_record()(pre: every earlier write to transfer/compute/indirect only; transfer->compute after the fills; compute->compute between task and mesh; post: to the draw stages when the interrupted pass resumes, with that pass's start barrier left out), ported behind a local switch, off by default;RX_VK_MESH_GLOBAL_ATTRS=1; P:RX_VK_MESH_PAGES=1(the Intel defaults);Each run: a fresh profile from the repository's
castle-gatesave, over the drawbridge and 1-2 minutes in Hyrule Field turning the camera,RX_VK_LOAD=start,RX_VK_PASS_TIMING=1. For G and P the programs were prepared with that switch first (--prepare-shaders), so every run reports47796 program keys keptand translates nothing in play. One run per setting.GLOBAL_ATTRS=1)PAGES=1)m fallbacka frameReading:
fallback prog 42f995f9f0e8e5c7~145 us x4 a frame,739acd678ae08655andd905f52b7517c681~260 us once a frame).RX_VK_MESH_GLOBAL_ATTRS=1costs about 35% more fallback time here andRX_VK_MESH_PAGES=1about 7% more. That supports keeping both scoped to Mesa Intel, as this PR does.RX_VK_MFB_BATCH/RX_VK_MFB_CULL(not ported), and I did not compare pictures between the runs.Logs stay on my PC (game-derived). Happy to run something specific on this card if it helps.
@HumanBean wrote in #2515 (comment):
Sure! i will split it and submit the PR's shortly
Thanks for splitting it. One request for the split: could
RX_VK_MFB_BATCHgo in a pull request of its own, so that it can be measured on AMD?As it is at
949a5d96, its default is not limited to Mesa's Intel driver.mfb_batch_limit()turns it on for every GPU that runs the compute fallback, 2 to 4 slots by the VRAM allowance (4 on an 8 GB RX 580), while the description says the vendor defaults apply only onVK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA. Nobody has run it on AMD yet, and Simaude's GTX 1070 data above leaves it out too.It could help AMD players more than anyone. AMD cards without mesh shaders (RX 400/500 and Vega on GCN, RX 5000 on RDNA 1) send every task and mesh draw through the fallback, and today each of those draws ends its render pass and starts it again. What those cards show:
RX_VK_PASS_TIMING=2): 238 pass spans took 5.89 ms and 789 barrier spans 1.82 ms of a frame, beside 3.49 ms for the fallback's dispatches.What would make it measurable on AMD:
RX_VK_MFB_BATCH=0against the default, on an AMD card without mesh shaders. Run it on Windows (AMD's driver) and on Linux (RADV), for example on an RX 580 and an RX 5600 XT or 5700 XT, at the Market or in Kokiri Forest. Report fps, 1% low, GPU time a frame and the pass and barrier spans, and compare pictures.RX_VK_MFB_CULLor the narrowed barriers in the same change, so that the number is the batching's.Once it is split, the Test Farm's AMD cards can run that A/B.
Recommendation: Request changes. Proceed with the topic split discussed with the author. This is targeted triage of the renderer paths below. The full 90-file bundle needs review in those smaller PRs.
The historical 17.2→23.3 FPS Courtyard run on Iris Xe corresponds to the measured earlier bundle through
dd991ac7. This head adds further memory changes and the reported gain does not isolate any of the proposed splits. The head also conflicts with current main across fifteen files. Rebase the chosen splits and measure each on its current base. Split discussion · CIReviewed the above paths at
949a5d962ebe6a890f831121666498070fe0de60against actual merge basebe663a08. The rest of the shader and frame-generation changes remain unreviewed.@ -495,2 +515,2 @@if (!dev.features.shaderStorageImageExtendedFormats || !dev.features.shaderStorageImageWriteWithoutFormat) {logf("vk: fsr3: not on this GPU: no extended storage image formats, or no storage writes without a format");if (!dev.features.shaderStorageImageExtendedFormats || !dev.features.shaderStorageImageWriteWithoutFormat ||!dev.vk12.shaderFloat16) {[P2] Keep the previously supported FP32 FSR path. This new requirement rejects devices that otherwise meet the existing eligibility checks.
@ -1663,1 +1912,3 @@const std::vector<uint32_t> spirv = Shader::Backend::SPIRV::EmitSPIRV(profile_pinned(uint64_t(wg[0]) * wg[1] * wg[2]), rt, t->program, bindings);std::vector<uint32_t> spirv = Shader::Backend::SPIRV::EmitSPIRV(profile_pinned(uint64_t(wg[0]) * wg[1] * wg[2]), rt, t->program, bindings);bool used_custom_spv = false;if (p.key == 0xab7699ee7f536755ull && !env_on("RX_VK_NO_CUSTOM_SHADERS")) {[P2] Make this shader override reproducible and gate it on the required driver/capabilities. Matching the program key currently activates it across drivers before the existing subgroup eligibility check.
Measurements of
RX_VK_MFB_BATCHandRX_VK_MFB_CULLfrom this PR, on an RX 580 8 GB (GCN4, RADV Mesa 26.2.6, Linux). It has no mesh shaders, so every mesh draw takes the compute fallback. Thanks for the work on these. On this card, against currentmain, neither switch gains, andBATCH=8costs a lot.Setup
main@ae32c0dd, which already hasRX_VK_GP_FAST32(#2839) and #2860. Your two switches, the cull push words, the batch slots and the replay scan came over. FAST32, the narrowed dispatch barriers and the unbatchedfallback_recordbarrier changes stayed out. The TaskEpilogue one-atomic-per-workgroup change and the vertex body's addressing came along, unconditionally.mainbuild. The CULL arms used their own copy, since the switch changes the shader stamp.Screening, 1 lap each (field: fps avg / 1% low / GPU ms)
Confirmation, 3 laps a run, interleaved (round 1 complete; round 2 has main and BATCH=4)
What this shows
BATCH=4is about 0.6–1.3 ms more GPU time thanmainacross the 3-lap runs, and 4–5 % slower in the field. At 8 slots it's +6 ms. The narrowed post barrier and the skipped pass-start barrier don't make up for it on GCN.CULLalone is within noise ofmain(40.6 vs 40.5–41.0 fps).mainnow has.mainno more than twomainruns differ from each other, so I saw no dropped geometry. The scenes move, so that's no pixel-exact check.So for GCN/RADV both switches should stay off, which matches this PR's defaults (BATCH by VRAM on fallback GPUs; CULL on ANV only). The BATCH default needs care, though: on an 8 GB card it would pick 4 slots, which measured slower here. Gating it to ANV, as CULL is, would keep AMD out. I'm not opening a separate PR for these two switches, since they gain nothing on this card.
🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.