Repository navigation
macOS: add ANGLE/MoltenVK feature overrides for mvk-angle - #137
Open
hellohellohello111 wants to merge 2 commits into
Open
hellohellohello111 wants to merge 2 commits into
hellohellohello111 wants to merge 2 commits into
Conversation
When using the Vulkan-backend ANGLE with MoltenVK on macOS, black rendering artifacts appear because MoltenVK maps Vulkan's VK_ATTACHMENT_LOAD_OP_DONT_CARE to Metal's MTLLoadActionDontCare, which leaves tile memory undefined on Apple Silicon GPUs. This adds ANGLE feature overrides that force proper resource initialization and conservative render pass management, eliminating the black rectangle artifacts. Also forces synchronous MoltenVK queue submits to prevent frame tearing. All overrides use setenv(overwrite=0) so users can still customize via profile environment variables in the launcher UI. Tested on Apple M4 Pro, macOS 26, Minecraft 1.26.10.4 — Fancy graphics mode renders with zero artifacts. Ref: minecraft-linux/mcpelauncher-manifest#1755
Systematic split testing identified which flags actually help: - forceRobustResourceInit: fixes black boxes (heavy → medium ghost) - preferSkippingInvalidateForEmulatedFormats: KEY — blocks glInvalidateFramebuffer from triggering DontCare store ops on G-buffer attachments, reducing ghost from medium → light - allowClearForRobustResourceInit: efficient init clears Removed flags that A/B testing proved have no effect on artifacts: - hasCheapRenderPass (disabled) — no measurable impact - flushAfterStreamVertexData — no measurable impact - preferDrawClearOverVkCmdClearAttachments — no measurable impact Ref: minecraft-linux/mcpelauncher-manifest#1755
Author
|
CI note: The 4 failing jobs (linux/build, linux/build32, linux/buildbusterappimage, macOS/build-protobuf) are pre-existing failures on master — they fail identically on the latest master CI run from Dec 30, 2025. The failures are from GLIBC version mismatches in the Docker containers and a protobuf build script issue, unrelated to this PR. All macOS jobs pass cleanly, including the ARM64 build-m1 job which is the one that compiles and tests this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setenv(overwrite=0)so users can still override via profile environment variablesWhat it does
When ANGLE uses
VK_ATTACHMENT_LOAD_OP_DONT_CARE, MoltenVK maps it to Metal'sMTLLoadActionDontCarewhich leaves tile memory undefined on Apple Silicon — showing as scattered black rectangles over 3D geometry. These overrides force proper initialization:hasCheapRenderPass(disabled)forceRobustResourceInitallowClearForRobustResourceInitflushAfterStreamVertexDatapreferDrawClearOverVkCmdClearAttachmentsMVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS=1Testing
#ifdef __APPLE__block)Change size
14 lines added to
src/main.cpp, inside the existing mvk-angle detection block.Ref: minecraft-linux/mcpelauncher-manifest#1755
🤖 Generated with Claude Code