vulkan: accept MoltenVK devices without minLod, buffer int64 atomics, and cull distance (#1068) #2402

Closed
github-bot wants to merge 1 commit from gh-pr/2402/head into gh-pr/2402/base
Owner

@⁠mitsa-ng on GitHub · 2026-11-19 01:34 UTC · original
vulkan-moltenvk-features → main · +36 −8 · 2 files · 1 commits · closed without merging

Fixes #1068.

Problem

The official macOS build rejects the only GPU on every Mac and exits with "Could not find suitable device" before a game loads. Stock MoltenVK (the v1.4.2 the release workflow bundles) never reports image view minLod, shaderBufferInt64Atomics, or shaderCullDistance, and all three are unconditional selection requirements:

  • check_feature(min_lod.minLod, ...)
  • check_feature(features12.shaderBufferInt64Atomics, ...)
  • check_feature(device_features2.features.shaderCullDistance, ...)

Change

On __APPLE__, treat the three exactly like depthClipEnable/depthBounds today: log them at selection, request only what the device supports at creation (features12.shaderBufferInt64Atomics, shaderCullDistance), drop VK_EXT_image_view_min_lod from the required device extensions, unlink its feature struct from the creation chain, and skip the VkImageViewMinLodCreateInfoEXT chain in imageView.cpp (sampling clamps at the base level instead). Non-Apple paths are unchanged: selection still requires all three, so the assignments are no-ops there.

Evidence

On an Apple M2 (macOS 27.2, Rosetta 2) with the same MoltenVK v1.4.2 release tarball the workflow bundles (SHA-256 verified): instance creation, device enumeration, and selection now pass all three checks; the device_creation mode of shader_recompiler_compute_tests advances past them to the next MoltenVK gap (nullDescriptor, a separate limitation outside this issue's scope). macOS x86_64 and Windows builds are green on my fork's CI (same change set).

Note: shaders that actually emit CullDistance outputs or 64-bit buffer atomics may still fail per-pipeline on MoltenVK; per the issue, capability fallbacks in the recompiler are follow-up work. Most titles do not use them.

Written with AI assistance (ZCode); the change was built and tested by the author on real hardware.

**@⁠mitsa-ng** on GitHub · 2026-11-19 01:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2402) `vulkan-moltenvk-features` → `main` · +36 −8 · 2 files · 1 commits · closed without merging Fixes #1068. ## Problem The official macOS build rejects the only GPU on every Mac and exits with "Could not find suitable device" before a game loads. Stock MoltenVK (the v1.4.2 the release workflow bundles) never reports image view minLod, shaderBufferInt64Atomics, or shaderCullDistance, and all three are unconditional selection requirements: - `check_feature(min_lod.minLod, ...)` - `check_feature(features12.shaderBufferInt64Atomics, ...)` - `check_feature(device_features2.features.shaderCullDistance, ...)` ## Change On `__APPLE__`, treat the three exactly like depthClipEnable/depthBounds today: log them at selection, request only what the device supports at creation (`features12.shaderBufferInt64Atomics`, `shaderCullDistance`), drop `VK_EXT_image_view_min_lod` from the required device extensions, unlink its feature struct from the creation chain, and skip the `VkImageViewMinLodCreateInfoEXT` chain in `imageView.cpp` (sampling clamps at the base level instead). Non-Apple paths are unchanged: selection still requires all three, so the assignments are no-ops there. ## Evidence On an Apple M2 (macOS 27.2, Rosetta 2) with the same MoltenVK v1.4.2 release tarball the workflow bundles (SHA-256 verified): instance creation, device enumeration, and selection now pass all three checks; the `device_creation` mode of `shader_recompiler_compute_tests` advances past them to the next MoltenVK gap (`nullDescriptor`, a separate limitation outside this issue's scope). macOS x86_64 and Windows builds are green on my fork's CI (same change set). Note: shaders that actually emit CullDistance outputs or 64-bit buffer atomics may still fail per-pipeline on MoltenVK; per the issue, capability fallbacks in the recompiler are follow-up work. Most titles do not use them. Written with AI assistance (ZCode); the change was built and tested by the author on real hardware.
MoltenVK never reports image view minLod, shaderBufferInt64Atomics, or
shaderCullDistance, so device selection rejected the only GPU on every
Mac and the emulator exited before loading a game. Treat the three like
depthClipEnable and depthBounds on Apple: log them at selection, request
only what the device supports at creation, drop
VK_EXT_image_view_min_lod from the required extensions, and skip the
image-view minLod chain.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:19:49 +00:00
github-bot closed this pull request 2026-11-26 10:19:49 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-19 01:39 UTC · original

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

On macOS, device selection logs missing support for image-view minimum LOD, shader buffer 64-bit atomics, and shader cull distance without rejecting the device. Device creation uses the queried support values for the two shader features. The image-view minimum-LOD extension is required only on non-macOS platforms, and Apple builds omit minimum-LOD view setup. Non-macOS feature checks and minimum-LOD setup remain in place.

Suggested reviewers: nmzik, senaxx

Change: Bug fix · Severity of issue fixed: High

Merge Risk: Minimal · up to 9ea0d

This change lets Apple devices running MoltenVK pass Vulkan device selection when they lack min-LOD, 64-bit buffer atomics, or cull distance support. Non-Apple platforms keep their current requirements. Some shaders may still fail per pipeline, which the PR documents as follow-up work. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: accepting MoltenVK devices that lack minLod, buffer int64 atomics, and cull distance support. It also matches the changeset, which relaxes these three selection checks…
Description check Passed The description states the problem (the macOS build rejects MoltenVK GPUs over three unsupported features), the change (Apple-only relaxation of the three checks, extension removal, chain changes, and…
Linked Issues check Passed [#1068] Requirements: on APPLE, stop rejecting devices for image view minLod, shaderBufferInt64Atomics, and shaderCullDistance; request only supported shader features; drop VK_EXT_image_view_min_l…
Out of Scope Changes check Passed All changes in the reviewed diff apply to the device selection, device creation, and minLod image-view paths named in #1068. Each change is either a Apple-only logging change, an Apple-only creation c…
Full details: Title check

Explanation

The title names the main change: accepting MoltenVK devices that lack minLod, buffer int64 atomics, and cull distance support. It also matches the changeset, which relaxes these three selection checks on macOS and drops the related extension and chain. The issue reference (#1068) is included and is accurate.

Full details: Description check

Explanation

The description states the problem (the macOS build rejects MoltenVK GPUs over three unsupported features), the change (Apple-only relaxation of the three checks, extension removal, chain changes, and skipping the minLod image-view chain), and the testing evidence. It matches the raw summary of file changes.

Full details: Linked Issues check

Explanation

[#1068] Requirements: on APPLE, stop rejecting devices for image view minLod, shaderBufferInt64Atomics, and shaderCullDistance; request only supported shader features; drop VK_EXT_image_view_min_lod from required extensions and the creation chain; skip the minLod image-view chain. Evidence: the reviewed vulkanWindow.cpp selection code (read directly) wraps check_feature for minLod, shaderBufferInt64Atomics, and shaderCullDistance in #if defined(APPLE) blocks that only log the missing feature. The #else branches keep the original check_feature calls, so non-Apple selection is unchanged. The creation-path changes (conditional shaderBufferInt64Atomics, reported shaderCullDistance value, macOS extension removal, unlinked min-LOD feature struct) and the imageView.cpp chain skip were read only from the supplied change summary. The file read was truncated before the creation section, so those parts were not verified against source. The subgroup vertex-stage failure and shader fallbacks for CullDistance/Int64Atomics are excluded by the PR objectives and are not required here.

Full details: Out of Scope Changes check

Explanation

All changes in the reviewed diff apply to the device selection, device creation, and minLod image-view paths named in #1068. Each change is either a Apple-only logging change, an Apple-only creation change, or the Apple-only skip of the minLod chain in imageView.cpp. Non-Apple behavior is unchanged per the selection code. No unrelated change was identified in the verified selection hunks. The creation and imageView.cpp hunks were assessed from the change summary only, because the source read was truncated.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a90be8dd73 and 9ea0de5cdd.

Files selected for processing: 2

  • src/graphics/host_gpu/renderer/image/imageView.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-19 01:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2402#issuecomment-6997022712) <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/2402?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_status_start --> No actionable comments were generated in the recent review. <!-- recent_review_status_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> On macOS, device selection logs missing support for image-view minimum LOD, shader buffer 64-bit atomics, and shader cull distance without rejecting the device. Device creation uses the queried support values for the two shader features. The image-view minimum-LOD extension is required only on non-macOS platforms, and Apple builds omit minimum-LOD view setup. Non-macOS feature checks and minimum-LOD setup remain in place. **Suggested reviewers:** `nmzik`, `senaxx` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"9ea0de5cdd50ea8d62146d4086c1730216d462a8" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix · **Severity of issue fixed:** High <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>9ea0d</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `9ea0d` --> <!-- final_review_risk_coverage:{"sourceCommitId":"9ea0de5cdd50ea8d62146d4086c1730216d462a8","coveredCommitId":"9ea0de5cdd50ea8d62146d4086c1730216d462a8","kind":"reviewed"} --> This change lets Apple devices running MoltenVK pass Vulkan device selection when they lack min-LOD, 64-bit buffer atomics, or cull distance support. Non-Apple platforms keep their current requirements. Some shaders may still fail per pipeline, which the PR documents as follow-up work. No merge-blocking risk was identified. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the main change: accepting MoltenVK devices that lack minLod, buffer int64 atomics, and cull distance support. It also matches the changeset, which relaxes these three selection checks… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description states the problem (the macOS build rejects MoltenVK GPUs over three unsupported features), the change (Apple-only relaxation of the three checks, extension removal, chain changes, and… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | [`#1068`] Requirements: on __APPLE__, stop rejecting devices for image view minLod, shaderBufferInt64Atomics, and shaderCullDistance; request only supported shader features; drop VK_EXT_image_view_min_l… | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | All changes in the reviewed diff apply to the device selection, device creation, and minLod image-view paths named in `#1068`. Each change is either a Apple-only logging change, an Apple-only creation c… | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main change: accepting MoltenVK devices that lack minLod, buffer int64 atomics, and cull distance support. It also matches the changeset, which relaxes these three selection checks on macOS and drops the related extension and chain. The issue reference (`#1068`) is included and is accurate. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description states the problem (the macOS build rejects MoltenVK GPUs over three unsupported features), the change (Apple-only relaxation of the three checks, extension removal, chain changes, and skipping the minLod image-view chain), and the testing evidence. It matches the raw summary of file changes. </dd> </dl> </details> <details> <summary><strong>Full details: Linked Issues check</strong></summary> <dl> <dd> <br> **Explanation** [`#1068`] Requirements: on __APPLE__, stop rejecting devices for image view minLod, shaderBufferInt64Atomics, and shaderCullDistance; request only supported shader features; drop VK_EXT_image_view_min_lod from required extensions and the creation chain; skip the minLod image-view chain. Evidence: the reviewed vulkanWindow.cpp selection code (read directly) wraps check_feature for minLod, shaderBufferInt64Atomics, and shaderCullDistance in `#if` defined(__APPLE__) blocks that only log the missing feature. The `#else` branches keep the original check_feature calls, so non-Apple selection is unchanged. The creation-path changes (conditional shaderBufferInt64Atomics, reported shaderCullDistance value, macOS extension removal, unlinked min-LOD feature struct) and the imageView.cpp chain skip were read only from the supplied change summary. The file read was truncated before the creation section, so those parts were not verified against source. The subgroup vertex-stage failure and shader fallbacks for CullDistance/Int64Atomics are excluded by the PR objectives and are not required here. </dd> </dl> </details> <details> <summary><strong>Full details: Out of Scope Changes check</strong></summary> <dl> <dd> <br> **Explanation** All changes in the reviewed diff apply to the device selection, device creation, and minLod image-view paths named in `#1068`. Each change is either a Apple-only logging change, an Apple-only creation change, or the Apple-only skip of the minLod chain in imageView.cpp. Non-Apple behavior is unchanged per the selection code. No unrelated change was identified in the verified selection hunks. The creation and imageView.cpp hunks were assessed from the change summary only, because the source read was truncated. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2402)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> <br> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <!-- tips_end --> <!-- recent_review_start --> <h6> <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <br> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/a90be8dd7304640cf4176a975871d51443710292/.coderabbit.yaml>) - **Commit**: [a90be8d](<https://github.com/KytyPS5/KytyPS5/commit/a90be8dd7304640cf4176a975871d51443710292>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `cd0fd18d-b28f-46dd-b538-27ec45805b46` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between a90be8dd7304640cf4176a975871d51443710292 and 9ea0de5cdd50ea8d62146d4086c1730216d462a8. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 2</strong></summary> <dl> <dd> <br> * `src/graphics/host_gpu/renderer/image/imageView.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- recent_review_end -->
Author
Owner

@⁠mitsa-ng on GitHub · 2026-11-19 09:08 UTC · original

CI evidence: this exact branch is green on all three platforms on my fork (same workflow): run 44490155357 — Windows, Linux, macOS all success. Also verified on real hardware (Apple M2, Rosetta 2, MoltenVK v1.4.2 release tarball with the workflow's SHA-256) that selection passes the three relaxed checks; the device_creation mode of shader_recompiler_compute_tests now advances past them.

**@⁠mitsa-ng** on GitHub · 2026-11-19 09:08 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2402#issuecomment-7004689956) CI evidence: this exact branch is green on all three platforms on my fork (same workflow): [run 44490155357](https://github.com/mitsa-ng/KytyPS5/actions/runs/44490155357) — Windows, Linux, macOS all success. Also verified on real hardware (Apple M2, Rosetta 2, MoltenVK v1.4.2 release tarball with the workflow's SHA-256) that selection passes the three relaxed checks; the `device_creation` mode of `shader_recompiler_compute_tests` now advances past them.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.