Repository navigation
zink: disable implicit_sync on Borealis and Honeykrisp - #618
Conversation
Both VK_DRIVER_ID_MESA_HONEYKRISP and VK_DRIVER_ID_AURORA_BOREALIS are open-source Mesa drivers with explicit WSI synchronization, matching the other Mesa drivers listed in init_driver_workarounds(). Leaving implicit_sync enabled causes kopper_present() on Wayland to submit an extra empty queue submission and block synchronously in vkWaitForFences() on the render thread inside eglSwapBuffers. Signed-off-by: Diljit Singh <hey@djdev.me>
When VK_EXT_pipeline_robustness is supported alongside robustBufferAccess, defer buffer robustness from device-wide robustBufferAccess/robustBufferAccess2 to per-pipeline VkPipelineRobustnessCreateInfoEXT while keeping nullDescriptor and image robustness intact at the device level. Non-robust OpenGL contexts then request DISABLED buffer robustness per pipeline instead of triggering device-wide indirect index repair and vertex/buffer bounds checks on drivers such as Borealis, while PIPE_CONTEXT_ROBUST_BUFFER_ACCESS contexts request ROBUST_BUFFER_ACCESS_EXT on monolithic graphics and compute pipelines. Signed-off-by: Diljit Singh <hey@djdev.me>
…euse robust-index draw state Propagate resolved VK_EXT_pipeline_robustness vertexInputs behavior through vk_graphics_pipeline_state (on VERTEX_INPUT_INTERFACE_BIT_EXT, merged and copied across graphics pipeline libraries) and vk_dynamic_graphics_state (dirtying MESA_VK_DYNAMIC_VI on change and clearing on vkCmdBindShadersEXT). In Borealis, include state->vi_robustness in hk_vs_key for static-VI and LTO-linked GPL vertex shader compiles, and query hk_cmd_vertex_input_robustness() in hk_fill_fast_link_key_vs(), hk_flush_dynamic_state_slow(), and hk_needs_index_robustness() so monolithic pipelines, fast-link GPL, and optimized-link GPL all honor per-pipeline vertex input robustness instead of forcing robust index repair and D3D vertex bounds checking whenever pipelineRobustness is enabled on the device. Also reuse hk_g17p_draw_state_offset() in hk_emit_robust_index() so robust indirect draws share the cached draw-state selector upload instead of allocating a fresh 8-byte VDM pool entry per sub-draw. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Rebased cleanly onto current Verified full native build + Assisted-by: LLM (Gemini:4 Neon) |
140d767 to
4588160
Compare
There was a problem hiding this comment.
Verdict: REQUEST CHANGES at 45881608
Blockers:
- Branch is
CONFLICTINGwithaurora-wip. Rebase/merge currentaurora-wipacross the 12 touched files (+217/-52) so the PR isMERGEABLE. - Missing exact-head build/host test and dual GPU-generation hardware verification. After rebasing, post Asahi host test results and hardware verification covering both Zink and Borealis changes.
Checked:
- Metadata and diff summary (
+217/-52, 12 files),CONFLICTINGagainstaurora-wip.
Evidence
- Resolve
CONFLICTINGagainstaurora-wipbefore code/hardware sign-off.
There was a problem hiding this comment.
Verdict: HOLD at b4e585c8066e
Blockers:
- Update the PR title and description to match the narrowed
+2/-0scope atb4e585c8066e(the per-pipeline GPL vertex-input-robustness work has already landed onaurora-wip; this branch now only disablesimplicit_syncinsrc/gallium/drivers/zink/zink_screen.c). - Post exact-head
b4e585c8066ebuild/unit-test results and Wayland Zink swapchain/presentation verification on two GPU generations confirming disablingimplicit_syncworks without visual corruption, hangs, or frame-pacing regressions.
Checked:
- Audited the full
+2/-0diff insrc/gallium/drivers/zink/zink_screen.c(init_driver_workarounds()): adds both Borealis Vulkan driver IDs to thescreen->driver_workarounds.implicit_sync = falseswitch arm alongsideVK_DRIVER_ID_MESA_NVKandVK_DRIVER_ID_MESA_KOSMICKRISP. - Confirmed
MERGEABLEagainstaurora-wipwith no remaining Borealis shader/GPL changes in the diff.
Evidence
- Head:
b4e585c8066e772591dbfd22ae3156418d0373be(baseaurora-wip,MERGEABLE). - Diff stat:
src/gallium/drivers/zink/zink_screen.c | 2 ++. - Note:
zink_screen.cmatches both the legacy and current Borealis driver ID constants cleanly; no other files are modified.
There was a problem hiding this comment.
Verdict: MERGE at b4e585c8066e
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited the full +2/-0 diff in src/gallium/drivers/zink/zink_screen.c (init_driver_workarounds()): adds both Borealis Vulkan driver IDs to the screen->driver_workarounds.implicit_sync = false switch arm alongside VK_DRIVER_ID_MESA_NVK and VK_DRIVER_ID_MESA_KOSMICKRISP.
- Confirmed
MERGEABLEagainstaurora-wipwith no remaining Borealis shader/GPL changes in the diff.
Follow-ups (not blocking): update title/body to +2/-0 implicit_sync scope; head build + Wayland Zink row (one GPU gen enough)
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J700 (G17P) row at head mesa#618 · J700 MacBook Neo (A18 Pro, G17P B1), stock Fedora 44 7.3.0-41.fc44.aurora.aarch64, same boot, base 8b59f2b vs head b4e585c: INCOMPLETE (618-egl incomplete (3 NotRun at head)) — Wayland present on a private headless weston (Zink, 256×256 window): interval-0 1273 → 1197 fps (-6.0%), interval-1 swap median 15250 → 15216 µs, every pre-swap readback matched; glmark2-es2-wayland via Zink score 3230 → 7677 (+137.7%), validation base 27 Success / 6 Unknown / head 27 Success / 6 Unknown; 618-gles3 865/865 compared, base 860 Pass / 5 NotSupported → head 860 Pass / 5 NotSupported, 0 status changes; 618-gles31 571/571 compared, base 569 Pass / 1 NotSupported / 1 Fail → head 569 Pass / 1 NotSupported / 1 Fail, 0 status changes; 618-egl 115/118 compared, base 89 Pass / 21 NotSupported / 4 Fail / 3 NotRun / 1 Timeout → head 89 Pass / 21 NotSupported / 4 Fail / 3 NotRun / 1 Timeout, 0 status changes; 0 GPU faults, 0 kernel WARNINGs; stock handback verified. About "INCOMPLETE": 3 EGL cases recorded NotRun in both arms (same list at base), and every compared case matches. Under Zink on a private headless weston, glmark2 rose +137.7 % and interval-1 swap timing is flat, but interval-0 present throughput fell 6.0 % (1273 → 1197 fps, 256×256). That is worth a look before merge: implicit sync off may change how often frames are presented when nothing waits for vblank. Kit B payload |
|
Row:
|
|
Local check on the merge tree (pc, x86-64 clang, asserts on, Rows at this head: J773g Wayland I retitled it to match the two-line diff; the robustness half of the old series is already on |
What: Zink applies its implicit-sync workaround to every Vulkan driver it doesn't list as syncing WSI explicitly. On Wayland that adds an empty queue submission and a fence wait inside
eglSwapBuffers. Borealis and Honeykrisp sync WSI explicitly, so this adds both driver IDs to the explicit-sync list ininit_driver_workarounds()(zink_screen.c). The per-pipeline robustness half of the original series is already onaurora-wipthrough #899 and #905.Tested: The "commit 1 only" arm in the earlier description below is exactly this diff: Minecraft 26.3 over Zink on J773g went from 32.8 to 44.8-45.5 FPS, with 0 GPU faults. That was on an older base. Merge-result CI on current
aurora-wippassed: https://github.com/DjDeveloperr/mesa/tree/ci/head-618-0f80eed3.Risk: two-way door · GL through Zink on Borealis and Honeykrisp, on every Mac. Native GL and Vulkan applications are unaffected.
Not yet: rows at this head on J773g and J700: Zink Wayland present and synchronization, base against head.
Earlier description (three-commit series)
Problem
Running OpenGL applications over Zink on Borealis incurs two avoidable bottlenecks on Wayland and on indirect indexed draws:
init_driver_workarounds()does not listVK_DRIVER_ID_AURORA_BOREALIS(orVK_DRIVER_ID_MESA_HONEYKRISP) among the drivers with explicit WSI synchronization, leavingimplicit_sync = true. On Wayland,kopper_present()submits an extra empty queue submission and blocks invkWaitForFences()on the render thread insideeglSwapBuffers.VK_EXT_robustness2is available, Zink enablesrobustBufferAccessandrobustBufferAccess2globally onVkDeviceeven for non-robust OpenGL contexts. On Borealis,hk_needs_index_robustness()and the vertex input lowering paths previously checked device-levelenabled_features.{robustBufferAccess,robustBufferAccess2,pipelineRobustness}, forcing per-draw compute index-buffer repair (libagx_draw_robust_index_batch), CDM-to-VDM barriers, per-sub-draw draw-state pool uploads, and D3D vertex bounds checks on every indirect indexed draw.Change
Three commits cleanly targeting
aurora-wip(fa9a6766c01), gated purely on driver identity / Vulkan extension capabilities (no chip, board, or firmware gates; works with default configuration):zink: disable implicit_sync workaround on Honeykrisp and Borealis(src/gallium/drivers/zink/zink_screen.c)VK_DRIVER_ID_AURORA_BOREALISandVK_DRIVER_ID_MESA_HONEYKRISPto the explicit-sync driver list ininit_driver_workarounds(), matching other open-source Mesa Vulkan drivers.zink: use VK_EXT_pipeline_robustness for per-context buffer robustness(src/gallium/drivers/zink/{zink_device_info.py,zink_pipeline.c,zink_program.{c,h},zink_screen.c,zink_types.h})VK_EXT_pipeline_robustnessis supported alongsiderobustBufferAccess, defers buffer robustness from device-widerobustBufferAccess/robustBufferAccess2to per-pipelineVkPipelineRobustnessCreateInfoEXTwhile preservingnullDescriptorand image robustness at the device level.VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXTper pipeline;PIPE_CONTEXT_ROBUST_BUFFER_ACCESScontexts requestVK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXTon graphics and compute pipelines.borealis: honor per-pipeline vertex input robustness across GPL and reuse robust-index draw state(src/vulkan/runtime/{vk_graphics_state.{c,h},vk_shader.c},src/asahi/vulkan/{hk_cmd_draw.c,hk_shader.{c,h}})VkPipelineRobustnessCreateInfoEXT::vertexInputsthroughvk_graphics_pipeline_state(onVK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT, merged and copied across GPL libraries) andvk_dynamic_graphics_state(dirtyingMESA_VK_DYNAMIC_VIon change and clearing onvkCmdBindShadersEXT()).state->vi_robustnessinhk_vs_keyfor static-VI and LTO-linked GPL compiles, queries the effective command/pipeline vertex input robustness inhk_fill_fast_link_key_vs(),hk_flush_dynamic_state_slow(), andhk_needs_index_robustness(), and reuseshk_g17p_draw_state_offset()inhk_emit_robust_index().Testing
Tested on Apple M4 Mac mini (
Apple M4 (G16G B0)), Arch Linux ARM, kernel7.3.0-ARCH-m4drv8, headless Wayland (kwin_wayland --virtual --width 1920 --height 1080), Minecraft 26.3 (RD 12,Fancy,VSync off,maxFps 260, fixed 50sstill:15,spin:15,fly:20benchmark scene). All timed rows satisfied thermal and load gates (hotspot <= 70 C,load1 < 0.5), with 0 GPU kernel error/fault lines and 0 failed units.Same-Machine A/B Performance (Zink on Borealis vs Native Vulkan)
d4ad4a4dcee222fe5e62ed1ffa40c4e1ba7c727a(branch head140d767cba6)ed1ffa40c4SDL_GL_SwapWindow(eglSwapBuffers) dropped from 77.4% (~22.3 ms/frame) at baseline to 30.7% (~6.8 ms/frame) after Commit 1 and 8.5% (~0.85 ms/frame) after Commits 2–3. Process CPU per frame dropped -65.7% to -66.2% (29.46 -> 9.96–10.10 ms/frameinstill), matching native Vulkan (8.93 ms/frame).Conformance Gates (VK-GL-CTS 1.4.7.1, 0 GPU faults)
vk-robust(2,845 cases:vk-vertex-index-robustness,vk-pipeline-robustnessincl.vert_{fast,optimized}_gpl,vk-robustness2-vi)e1ba7c727a)vertex_attribute_fetchcases 8 / 8 Passgles31-mdi-gate+gl46-mdi-gate(458 cases)e1ba7c727a)gles31-mdi-gate+gl46-mdi-gateed1ffa40c4)KHR-NoContextrobustness5411b98d71)Driver identities, benchmark settings, and build options
-Dbuildtype=release -Db_ndebug=true),gallium-drivers=asahi,zink,vulkan-drivers=asahi,llvm=disabled,spirv-tools=disabled,glvnd=enabled,clang 23.1.5(aarch64).e1ba7c727ae449f818510dad36476177f115bf38):libvulkan_asahi.soSHA256:106a6c75259013de75767acd448914bbd6ceb4ec502803657ee692b50228a552libgallium-26.3.0-devel.soSHA256:49128984b68ef82971dede735ecf67c8a19ad5d0715529f800dddc8010991917Temurin 25.0.5,-Xms1G -Xmx2560M -XX:+UseZGC -XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication),renderDistance:12,graphicsPreset:"fancy",enableVsync:false,maxFps:260,1920x1080fullscreen on headless KWin Wayland,MESA_LOADER_DRIVER_OVERRIDE=zinkfor Zink rows.99.0 FPSvs99.7 FPSbaseline, within ~0.7% run-to-run variance) and conformance are preserved; robust GL contexts continue to enforceROBUST_BUFFER_ACCESS_EXTper pipeline.Still to run
Not yet