Skip to content

Releases

Intel Iris Xe / Gen12 Optimization — v2.0 (Upstream Rebase + ANV PointCoord Sky Fix + 1080p Showcase)

Choose a tag to compare

@bbarrosdavi bbarrosdavi released this 25 Nov 07:17

perf(vk): Intel Iris Xe / Gen12 (Mesa ANV) optimizations, ANV PointCoord SBE fix, iGPU UMA accounting, FP16 FSR 3.1 & 3D-MV FrameGen

Summary

On Intel Iris Xe / Gen12 integrated GPUs (Linux Mesa ANV 26.2.4, 16 GB UMA), upstream main @ 209389fa exhibits four major blockers during gameplay:

  1. Severe throughput & latency bottlenecks on 96-EU Gen12 (mesh fallback barriers, SIMD8 register spills, FP32 FSR 3.1 + dlss_out.comp roundtrip, SLM-heavy RCAS, and 64-bit guest page-table indexing).
  2. Rapid OOM crashes on 16 GB unified-memory laptops: system_heap_usage() in gpu/vk/vk_vma.cpp skipped unified-memory single-heap iGPUs, preventing imports_give_back() and Linux memory-pressure eviction from unpinning retired DMA-BUF imports, while per-thread TLS_OBJECT fallback slots duplicated ~1.40 GB across Presentation Thread and host.
  3. Blinding yellow-white sky/sun screen blowout on Mesa ANV 26.2.4: After any shader reading BuiltIn PointCoord (e.g., simulated-turf shadow) draws in a VkCommandBuffer, Mesa ANV leaks 3DSTATE_SBE::PointSpriteTextureCoordinateEnable = 1 onto subsequent pipelines in that same command buffer, overwriting Location 0 with PointCoord.x = 0.5 on subsequent POINT_LIST draws. In OoT's 1×1 sun visibility pass (edd4d7c51103645d, 25 additive points), G accumulated to 12.5 instead of 0..1, blowing out all 11 sun lens-flare draws across the entire viewport.
  4. Interior white bloom blow-out: Fragment outputs and OpImageWrite receiving ±Inf clamped to +65000.0 instead of 0.0, blowing out interior props (e.g. Link's House).

This branch (rebased onto upstream/main @ 209389fa, head 79beef54) fixes all four issues and lifts Courtyard throughput by +35.5% (17.2 → 23.3 Base FPS), cuts other buffers by -1.04 GiB (1,562 → 493–519 MB), keeps DMA-BUF imports steady at ~1.1–1.5 GB (0 retired still imported), eliminates the sky blowout with zero shader-cache invalidation, and adds low-latency 3D-MV FrameGen (Auto/2x/3x). All Intel-specific heuristics are scoped to VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA or runtime switches in gpu/vk/switches.def so NVIDIA and AMD paths are preserved.

Key files to review first:

  • gpu/vk/vk_draw.h, gpu/vk/vk_draw.cpp, gpu/vk/vk_replay.cpp — Mesa ANV 3DSTATE_SBE PointCoord tracking + split_part_forced(), shared FallbackBuffers pool under replay_mu, narrowed MFB/compute barriers, ahead=1 FrameGen queue.
  • gpu/vk/vk_vma.cpp — single-heap iGPU accounting in system_heap_usage() so imports_give_back() / Linux pressure unpins retired DMA-BUF imports.
  • gpu/vk/device_policy.h, gpu/vk/vk_texture.cpp, gpu/vk/switches.def — bc_small_runs on Mesa ANV, MFB_BATCH=2 cap on small_vram_textures, narrowed compute dispatch barriers.
  • gpu/vk/vk_fsr3.cpp, gpu/vk/vk_temporal.cpp, gpu/vk/vk_framegen.cpp, gpu/vk/shaders/fg_* — FP16 FSR 3.1 + fused P_ACCUMULATE_SQ, 5-tap L1 FP16 RCAS, universal 3D-MV FrameGen & pacing.
  • gpu/vk/eden/shader_recompiler/ — ±Inf/NaN guard (fng6), 32-bit guest page-table lookup (gp35), BDA→SSBO entry-function scoping, warp-32 (wg_warp_plan.h), and custom SPIR-V overrides (vk_custom_spv.h).

Gameplay Showcase (Live 1080p Capture 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×1080 with integrated 2× 3D-MV FrameGen via zero-copy VAAPI (wf-recorder -c h264_vaapi -d /dev/dri/renderD128 -p qp=20):

Watch 1080p Live Showcase on Intel Iris Xe — 5 Areas

Before vs. After Visual Comparison

Before — Unoptimized Upstream (~9 FPS) After — Optimized Build (23.3 Base / 46+ FG FPS, Kokiri Forest)
Unoptimized upstream 9 FPS Optimized Kokiri Forest
Before — First Functional Baseline (~13 FPS) After — Optimized Build (Hyrule Castle Path)
First functional baseline 13 FPS Optimized Castle Wagon

Testing

Tested:

  • Hardware / OS: 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=2 MAILBOX).
  • Live gameplay verification: Played and recorded across 5 distinct areas (Hyrule Market, Kakariko Village, Hyrule Field, Kokiri Forest, Zora's Domain) — zero crashes, zero GPU hangs, zero sky blowout during 360° camera pans, zero interior bloom spikes, and steady memory footprint (~1.1–1.5 GB active imports, 0 retired still imported).
  • ANV 3DSTATE_SBE PointCoord reproduction & verification: Confirmed the Mesa ANV 26.2.4 PointSpriteTextureCoordinateEnable leak with a standalone Vulkan repro + INTEL_DEBUG=bat, and verified across a headless 360° Kakariko sky sweep (edd4d7c51103645d mean 12.5 → 1.015, step-10 frame RGB mean [241.4, 232.9, 210.0] → [118.3, 116.0, 163.9], 0 shader-cache invalidation, 0.0 ms added waits) plus live confirmation.
  • Unit & GPU checks (RX_RELEASE=1 LONGSHOT_FSR=1):
    • Passing: 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 + INTEL_DEBUG=cs ISA audit (SIMD16, 0:0 spills) on all new/modified compute shaders.
    • third_party/xess/ verified completely untouched vs upstream/main.

Still to test:

  • Windows Intel Vulkan ICD (Iris Xe / Arc): Verify host build (llvm-mingw) and runtime paths where Mesa-only guards are bypassed (@Beanstalk / by hand).
  • NVIDIA & AMD (Tier 1 GPUs, Windows & Linux): Verify no regression in default non-Intel codepaths, FSR 3.1, and 3D-MV FrameGen (@Beanstalk).
  • Rebase onto latest upstream/main (be663a08+): Branch is currently based on 209389fa and can be split into topic-scoped PRs (e.g., ANV 3DSTATE_SBE PointCoord fix, single-heap iGPU UMA system_heap_usage() fix, narrowed fallback barriers, FP16 FSR 3.1, 3D-MV FrameGen) per maintainer preference.

Measurements

Verdict: +35.5% Base FPS in Hyrule Castle Courtyard (17.2 → 23.3 fps, 2.6× vs unoptimized ~9 fps), -18.3% worst-case frame time in Kakariko (107.9 → 88.2 ms), -1.04 GiB fallback buffer VRAM (1,562 → 493–519 MB), 0 retired DMA-BUF imports leaked, and 100% elimination of Mesa ANV 3DSTATE_SBE sky 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) and 1787×1005 → 1920×1080 (pass breakdown & progression).

1. 3-Way Unprofiled Comparison (1440×810 → 1080p, FSR 3.1, FG Off)

Metric Before: upstream/main @ 209389fa Intermediate: v1.0-iris-xe @ d56d9a3a After: This Branch (79beef54)
Courtyard (slot_01) Steady Base FPS 17.2 fps 20.8 fps 23.3 fps (+35.5% vs main, +12.0% vs v1)
Courtyard Slowest Frame (600f) 113.7 ms (13.8 s stall) 89.6 ms 86.9 ms
Courtyard Replay Submit (queue submit) — 15.04 ms (2.79 ms) 14.04 ms (0.00 ms)
Courtyard Full Barriers / Frame 518.3 310.1 406.4 (-112 vs main)
Courtyard Draws Skipped 140 (black 3D) 0 0
Kakariko Gate (slot_00) Steady FPS — 17.4 (16.85 avg) 17.3 (16.91 avg)
Kakariko Slowest Frame (600f) — 107.9 ms 88.2 ms (-18.3%)
Fallback other buffers VRAM 523 MB (1,562 MB w/ TLS dup) 4,077 MB total 493–519 MB (-1.04 GiB vs TLS dup)
Active DMA-BUF Imports (16 GB UMA) Unbounded growth → OOM...
Read more

Intel Iris Xe / Gen12 Optimization — v1.0

Choose a tag to compare

@bbarrosdavi bbarrosdavi released this 23 Nov 18:12

Pull Request: Intel Iris Xe / Gen12 (Mesa ANV) Performance, FP16 FSR 3.1, 3D-MV FrameGen & Low-Latency Optimizations

Summary

This PR contributes a comprehensive, empirically validated set of GPU, shader, Frame Generation, and latency optimizations targeting Intel Iris Xe / Gen12 integrated GPUs (Linux Mesa ANV) — while keeping all Intel-specific heuristics scoped to VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA (or runtime switches in gpu/vk/switches.def) so NVIDIA and AMD behavior is preserved.

Full Progression on Intel Core i5-1235U / Iris Xe 96 EUs (26W, Linux Mesa ANV 26.2.4, 1920×1080 @ 60 Hz)

Milestone Base FPS Displayed FPS GPU / Frame FrameGen Handover State
Unoptimized Upstream (nightly-469-9af4808f) ~9 ~9 >110 ms N/A Unplayable: black/rainbow surface corruption + i915 10s GPU hangs
First Functional Baseline (Batch 5–10) ~13 ~13–24 ~75 ms >160 ms Bootable, but blocky + Gen12 spill glow/white blow-out + hair fringes + ~7 ms optical-flow FG
Batch 14 (Visual Stability Checkpoint) 14.0 28.0 (2x) 53.9 ms 156.9 ms (BATCH=1) Clean visuals at 1787×1005 → 1920×1080 FSR 3.1 + 100% sharpness, high input lag
Batch 15 Final — FG Auto 20.56 (2.3× vs upstream / +58% vs func. baseline) 41.1 41.8–42.8 ms 35.1 ms (0 late) Clean across all areas + -50 ms GPU queue depth (ahead=1)
Batch 15 Final — FG 2x 20.1 40.2 42.2 ms 65.5 ms (0 late) Clean across all areas, 0 <12 ms bursts

Visual Comparison

Before — Unoptimized Upstream (~9 FPS) After — Optimized Build (20.6 Base / 41.1 Displayed FPS, Kokiri Forest)
Unoptimized upstream 9 FPS Optimized Kokiri Forest
Before — First Functional Baseline (~13 FPS) After — Optimized Build (20.6 Base / 41.1 Displayed FPS, Hyrule Castle Path)
First functional baseline 13 FPS Optimized Castle Wagon

Full technical write-up and per-pass breakdown: docs/intel_iris_xe_optimization.md.


Key Changes

1. FP16 FSR 3.1 + Fused dlss_out Elimination + L1 RCAS

  • Files: gpu/vk/vk_fsr3.h, gpu/vk/vk_fsr3.cpp, gpu/vk/vk_temporal.h, gpu/vk/vk_temporal.cpp, gpu/vk/shaders/fsr3_*_comp_spv.h, gpu/vk/shaders/fg_rcas.comp, gpu/vk/shaders/fg_rcas_comp_spv.h
  • Rewrote fsr3_accumulate, fsr3_prepare_reactivity, fsr3_prepare_inputs, and fsr3_luma_instability in FP16 (SIMD16, 0:0 spills:fills on Gen12).
  • Added kSquareOutput (SpecId 0) to P_ACCUMULATE_SQ to square perceptual RGB directly into VK_FORMAT_B10G11R11_UFLOAT_PACK32, eliminating dlss_out.comp (-33.2 MB/frame bandwidth) while exposing fsr3::last_upscaled_view() for exact FrameGen HUD diffing.
  • Replaced fg_rcas.comp's 10×10 SLM+barrier loop with direct 5-tap L1 FP16 texelFetch (12,066 → 2,148 Gen12 cycles, 5.6× fewer cycles).

2. Low-Latency Frame Generation & Universal 3D-MV Synthesis

  • Files: gpu/vk/vk_framegen.cpp, gpu/vk/vk_framegen.h, gpu/vk/vk_replay.cpp, gpu/vk/shaders/fg_copy_hud.comp, gpu/vk/shaders/fg_synth_mv.comp, gpu/vk/shaders/fg_synth2_mv.comp, gpu/vk/shaders/fg_mv_prep.comp
  • Added exact 3D camera + actor motion-vector FrameGen (fg_synth_mv / fused fg_synth2_mv) with trajectory consistency gating, safe unwarped near fallback (no character/shield/shadow shredding), and exact pre/post-HUD alpha masking in both Auto (frame_generation=1) and 2x/3x modes.
  • Capped Mesa Intel FrameGen in-flight depth to 1 frame (ahead=1) (vk_replay.cpp), overlapping CPU input/recording inside GPU execution with zero FPS loss and -50 ms input lag.
  • Improved display_main() pacing (vk_framegen.cpp) with unconditional backlog drain (q_now >= 1) and slack_ns dead-air phase convergence (0 late, 0 <12 ms).

3. Shader Recompiler, SPIR-V Passes & Gen12 Workarounds

  • Files: gpu/vk/eden/shader_recompiler/..., gpu/vk/vk_draw.cpp, gpu/vk/vk_custom_spv.h, gpu/vk/vk_shader.cpp, gpu/vk/switches.def
  • RX_VK_BDA_SSBO=1 (default on Mesa Intel): lowers UBO-aliased BDA page-table helpers to direct SSBO accesses, preventing i915 GPU hangs and cutting register spills.
  • RX_VK_CUSTOM_SPV=1 (default on Mesa Intel): SIMD16/SLM overrides for 48590e0b, e40dc98f, and 26fe0c70 (1.57 ms → 0.82 ms).
  • Warp-32 (wg_warp_plan.h), mesh-fallback batching (RX_VK_MFB_BATCH=4), lossless MFB triangle culling, CCS_E format-list preservation, LOAD_OP_CLEAR fusion, and opaque-only equal_depth_bias (fixes both distant flashing hills and close-up hair/foliage fringes).
  • RX_VK_BDA_HOIST kept OFF by default (0) due to sparse/chunked pool boundary reads in dense areas.

4. Host CPU & Memory Efficiency

  • Files: host/nvdrv.c, host/rx_backend.c, gpu/vk/vk_memory.cpp, gpu/vk/vk_texture.cpp
  • AVX2 dirty-page collection (collect_in), adaptive 256 KB range merging, burst-scoped replay_mu, and UMA-friendly memory/worker defaults.

Testing & Verification Checklist

  • spirv-val --target-env vulkan1.2 + INTEL_DEBUG=cs ISA audit (SIMD16, 0:0 spills) on all new/modified compute shaders.
  • Full RX_VK_PASS_TIMING=2 GPU pass breakdown at 1787×1005 → 1920×1080 (dlss=3, sharpness=100%).
  • Unprofiled FPS, GPU ms, handover latency, and pacing (0 late, 0 <12 ms) verified in both Auto (frame_generation=1) and 2x (frame_generation=2).
  • 1:1 visual inspection of real and synthesized _made frames across Hyrule Castle (slot_01), Castle Town Market (slot_05), and Malon's Wagon (slot_00) — zero polygon spikes, zero neon bloom, zero hair fringes, intact HUD.
  • All Intel-specific paths scoped to VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA or runtime switches; zero regressions on non-Intel codepaths.