vulkan: start without fragmentShaderBarycentric on GPUs that lack it #1590

Manually merged
github merged 2 commits from gh-pr/1590/head into gh-pr/1590/base 2026-11-26 10:01:15 +00:00
Owner

@⁠theantipopau on GitHub · 2026-10-17 09:27 UTC · original
theantipopau:optional-barycentric-startup → main · +23 −6 · 1 files · 2 commits · merged 2026-10-17 10:55 UTC

Unblocks startup on Pascal (GTX 10xx), RDNA 1 and older drivers: #1432, #1416, #762.

Device selection rejected these GPUs with 'Could not find suitable device: ... fragmentShaderBarycentric is not supported'. But the SPIR-V backend (spirvEmitterModule.cpp) only emits CapabilityFragmentBarycentricKHR for pixel shaders with per-vertex/barycentric inputs, so most games never need it.

This makes the extension and feature optional on all platforms: warn at selection and at device creation, append the extension post-selection only when available, and chain VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR only when the device reports support. Shaders that need custom barycentrics fail at pipeline creation instead of blocking startup for every game.

Changed file: src/graphics/presentation/window/vulkanWindow.cpp only.

Verified: git diff --check clean. Full local build/ctest could not run here (CMake configure fails on the FFmpeg prebuilt download), so CI is the verification path; affected users on GTX 10xx / RX 5700 XT are the real validation.

**@⁠theantipopau** on GitHub · 2026-10-17 09:27 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1590) `theantipopau:optional-barycentric-startup` → `main` · +23 −6 · 1 files · 2 commits · merged 2026-10-17 10:55 UTC Unblocks startup on Pascal (GTX 10xx), RDNA 1 and older drivers: #1432, #1416, #762. Device selection rejected these GPUs with 'Could not find suitable device: ... fragmentShaderBarycentric is not supported'. But the SPIR-V backend (`spirvEmitterModule.cpp`) only emits `CapabilityFragmentBarycentricKHR` for pixel shaders with per-vertex/barycentric inputs, so most games never need it. This makes the extension and feature optional on all platforms: warn at selection and at device creation, append the extension post-selection only when available, and chain `VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR` only when the device reports support. Shaders that need custom barycentrics fail at pipeline creation instead of blocking startup for every game. Changed file: `src/graphics/presentation/window/vulkanWindow.cpp` only. Verified: `git diff --check` clean. Full local build/ctest could not run here (CMake configure fails on the FFmpeg prebuilt download), so CI is the verification path; affected users on GTX 10xx / RX 5700 XT are the real validation.
Pascal (GTX 10xx), RDNA 1 and older drivers have no
VK_KHR_fragment_shader_barycentric, so device selection rejected them
with 'Could not find suitable device' (#1432, #1416, #762). The SPIR-V
backend only emits the capability for pixel shaders with
per-vertex/barycentric inputs, so make the extension and feature
optional: warn at selection and creation, enable only when supported.
Shaders that need custom barycentrics fail at pipeline creation
instead of blocking startup for every game.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:01:13 +00:00
github manually merged commit 4cdf5160c0 into gh-pr/1590/base 2026-11-26 10:01:15 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 09:30 UTC · original · edited 2026-10-17 10:33 UTC

Review in Change Stack →

📝 Walkthrough

Vulkan physical-device selection no longer rejects devices that lack fragment shader barycentrics. The barycentric extension is optional. Device creation queries and enables the feature only when the extension and feature are supported.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: 🟡 Moderate · up to 4cdf5

On macOS, the barycentric extension is now enabled but its feature is not, so games whose shaders use barycentric inputs may fail at pipeline creation. Enable the feature in the Apple device-creation path before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: allowing Vulkan startup when fragment shader barycentric support is unavailable.
Description check Passed The description directly explains the Vulkan changes, affected GPUs, fallback behavior, and verification status.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 09:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1590#issuecomment-6232307693) · edited 2026-10-17 10:33 UTC <!-- 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/1590?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-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> Vulkan physical-device selection no longer rejects devices that lack fragment shader barycentrics. The barycentric extension is optional. Device creation queries and enables the feature only when the extension and feature are supported. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"4cdf5160c01c02f9f35979db83316249ac68dce5" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>🟡 Moderate</strong> · up to <code>4cdf5</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `4cdf5` --> <!-- final_review_risk_coverage:{"sourceCommitId":"4cdf5160c01c02f9f35979db83316249ac68dce5","coveredCommitId":"4cdf5160c01c02f9f35979db83316249ac68dce5","kind":"reviewed"} --> On macOS, the barycentric extension is now enabled but its feature is not, so games whose shaders use barycentric inputs may fail at pipeline creation. Enable the feature in the Apple device-creation path before merging. <!-- 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 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 warning</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :----------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><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> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly identifies the main change: allowing Vulkan startup when fragment shader barycentric support is unavailable. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains the Vulkan changes, affected GPUs, fallback behavior, and verification status. | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1590)! 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> - [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> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 09:30 UTC · original · edited 2026-10-17 10:30 UTC
On src/graphics/presentation/window/vulkanWindow.cpp line 275 (outdated):

@@ -266,8 +266,15 @@ static void VulkanFindPhysicalDevice(vk::Instance instance, vk::SurfaceKHR surfa
 #endif
 #if !defined(__APPLE__)
 		check_feature(device_features2.features.depthClamp, "depthClamp");
-		check_feature(fragment_barycentric.fragmentShaderBarycentric, "fragmentShaderBarycentric");
 #endif
+		// fragmentShaderBarycentric is optional: the SPIR-V backend only emits the
+		// capability for pixel shaders with per-vertex/barycentric inputs, so GPUs
+		// without VK_KHR_fragment_shader_barycentric (e.g. Pascal, RDNA 1) can still
+		// run games that do not use custom barycentrics. Shaders that need it fail
+		// at pipeline creation instead of blocking startup for every game.
+		if (fragment_barycentric.fragmentShaderBarycentric != VK_TRUE) {

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Keep the barycentric check inside the non-Apple branch.

On macOS, fragment_barycentric is not declared: its declaration is inside #else at Lines 224-227. The new read at Line 275 is outside that branch, so this file fails to compile for the supported macOS build. Guard the check with #if !defined(__APPLE__), or use a value declared on both paths.

✅ Addressed in commit 4cdf516

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 09:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1590#discussion_r4302209951) · edited 2026-10-17 10:30 UTC On `src/graphics/presentation/window/vulkanWindow.cpp` line 275 (outdated): ```diff @@ -266,8 +266,15 @@ static void VulkanFindPhysicalDevice(vk::Instance instance, vk::SurfaceKHR surfa #endif #if !defined(__APPLE__) check_feature(device_features2.features.depthClamp, "depthClamp"); - check_feature(fragment_barycentric.fragmentShaderBarycentric, "fragmentShaderBarycentric"); #endif + // fragmentShaderBarycentric is optional: the SPIR-V backend only emits the + // capability for pixel shaders with per-vertex/barycentric inputs, so GPUs + // without VK_KHR_fragment_shader_barycentric (e.g. Pascal, RDNA 1) can still + // run games that do not use custom barycentrics. Shaders that need it fail + // at pipeline creation instead of blocking startup for every game. + if (fragment_barycentric.fragmentShaderBarycentric != VK_TRUE) { ``` **🎯 Functional Correctness** | **🔴 Critical** | **⚡ Quick win** **Keep the barycentric check inside the non-Apple branch.** On macOS, `fragment_barycentric` is not declared: its declaration is inside `#else` at Lines 224-227. The new read at Line 275 is outside that branch, so this file fails to compile for the supported macOS build. Guard the check with `#if !defined(__APPLE__)`, or use a value declared on both paths. <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:12aed5be56adac4acd56b435 --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit 4cdf516
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 09:30 UTC · original · reviewed

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3cecc110-dfb7-4c95-8fc8-9f2f906d4de3
📥 Commits

Reviewing files that changed from the base of the PR and between c2173801d4 and 09d3139a5a.

📒 Files selected for processing: 1
  • src/graphics/presentation/window/vulkanWindow.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 09:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1590#pullrequestreview-5557214749) · **reviewed** **Actionable comments posted: 1** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `3cecc110-dfb7-4c95-8fc8-9f2f906d4de3` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between c2173801d47f65d840487e9998bddcbb601c6691 and 09d3139a5ac0a06de86dfbdb757690cb1ef12fb1. </details> <details> <summary>📒 Files selected for processing: 1</summary> * `src/graphics/presentation/window/vulkanWindow.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=4834e68f-0336-4f1b-91ee-9bef5b511aaf attempt=8bf4baa4-341c-4a57-a0d2-2ac5b2589e72 batch=1/1 -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 10:33 UTC · original · reviewed

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 Major · Enable fragmentShaderBarycentric on Apple devices. · vulkanWindow.cpp:1044

src/graphics/presentation/window/vulkanWindow.cpp:1044
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Enable fragmentShaderBarycentric on Apple devices.

The extension scan now adds VK_KHR_fragment_shader_barycentric on macOS, but the __APPLE__ device-creation branch does not chain fragment_barycentric. The SPIR-V emitter requires FragmentBarycentricKHR for pixel shaders with barycentric inputs, so those shaders may fail during pipeline creation. Before this PR, the extension was not added on Apple.

Suggested fix
-#if defined(__APPLE__)
-	robustness2.pNext = &features12;
-#else
 	vk::PhysicalDeviceFragmentShaderBarycentricFeaturesKHR fragment_barycentric {};
 	if (barycentric_supported) {
 		fragment_barycentric.pNext                     = &features12;
 		fragment_barycentric.fragmentShaderBarycentric = VK_TRUE;
 		robustness2.pNext                              = &fragment_barycentric;
 	} else {
 		robustness2.pNext = &features12;
 	}
-#endif

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 22c91ea1-3979-4fd1-a367-3c2452a85117
📥 Commits

Reviewing files that changed from the base of the PR and between 09d3139a5a and 4cdf5160c0.

📒 Files selected for processing: 1
  • src/graphics/presentation/window/vulkanWindow.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 10:33 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1590#pullrequestreview-5557404850) · **reviewed** > [!CAUTION] > Some comments are outside the diff and can’t be posted inline due to GitHub limitations. > > **⚠️ Outside diff range comments (1)** > > <details> > <summary><strong>🟠 Major</strong> · Enable <code>fragmentShaderBarycentric</code> on Apple devices. · <code>vulkanWindow.cpp:1044</code></summary><blockquote> > > `src/graphics/presentation/window/vulkanWindow.cpp:1044` > **🎯 Functional Correctness** | **🟠 Major** | **⚡ Quick win** > > **Enable `fragmentShaderBarycentric` on Apple devices.** > > The extension scan now adds `VK_KHR_fragment_shader_barycentric` on macOS, but the `__APPLE__` device-creation branch does not chain `fragment_barycentric`. The SPIR-V emitter requires `FragmentBarycentricKHR` for pixel shaders with barycentric inputs, so those shaders may fail during pipeline creation. Before this PR, the extension was not added on Apple. > > <details> > <summary>Suggested fix</summary> > > ```diff > -#if defined(__APPLE__) > - robustness2.pNext = &features12; > -#else > vk::PhysicalDeviceFragmentShaderBarycentricFeaturesKHR fragment_barycentric {}; > if (barycentric_supported) { > fragment_barycentric.pNext = &features12; > fragment_barycentric.fragmentShaderBarycentric = VK_TRUE; > robustness2.pNext = &fragment_barycentric; > } else { > robustness2.pNext = &features12; > } > -#endif > ``` > > </details> > > <!-- cr-comment:v1:ef0929855eb7c04bcce9400c --> > > </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `22c91ea1-3979-4fd1-a367-3c2452a85117` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 09d3139a5ac0a06de86dfbdb757690cb1ef12fb1 and 4cdf5160c01c02f9f35979db83316249ac68dce5. </details> <details> <summary>📒 Files selected for processing: 1</summary> * `src/graphics/presentation/window/vulkanWindow.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=7661af5c-6013-439a-9ac4-322a78feb31d attempt=67d7f5c8-30b7-4789-863b-0dffa692d0ed batch=1/1 -->
Author
Owner

@⁠theantipopau on GitHub · 2026-10-17 12:01 UTC · original

Addressed in d4c13487: the Apple device-creation path now chains fragmentShaderBarycentric conditionally like other platforms, so Macs that do expose VK_KHR_fragment_shader_barycentric get the feature enabled instead of silently dropping it.

**@⁠theantipopau** on GitHub · 2026-10-17 12:01 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1590#issuecomment-6233646882) Addressed in d4c13487: the Apple device-creation path now chains fragmentShaderBarycentric conditionally like other platforms, so Macs that do expose VK_KHR_fragment_shader_barycentric get the feature enabled instead of silently dropping it.
This discussion has been locked. Commenting is limited to contributors.
No description provided.