vulkan: accept devices without shaderResourceMinLod (#2434) #2515

Open
github-bot wants to merge 1 commit from github-bot/gh-2515 into main AGit
Owner

@⁠mitsa-ng on GitHub · 2026-11-22 09:50 UTC · original
mitsa-ng:vulkan-adreno-min-lod → main · +27 −13 · 6 files · 1 commits · open

Fixes #2434.

Problem

Device selection required shaderResourceMinLod unconditionally. Qualcomm Adreno (Windows ARM64 PRISM) never reports it, so the emulator rejected the only GPU and exited before loading a game.

Change

Downgrade the check to a logged warning, like fragmentShaderBarycentrics, and request only what the device supports at creation. The recompiler now knows the feature through Spirv::Profile: samples with a sampler clamp (_cl) skip the MinLod operand on devices without it, so their SPIR-V validates (the clamp is lost; explicit-LOD samples keep clamping through FMax, which needs no feature). The shader store header already contains the profile, so caches never mix variants. Drivers with the feature are unchanged.

Evidence

Green on Windows/Linux/macOS CI with this branch on my fork (run 44985645244). I have no Adreno device, so the runtime path is untested there; the degradation is the same warn-and-continue pattern the barycentric warning uses.

Written with AI assistance (ZCode); built and tested by the author.

**@⁠mitsa-ng** on GitHub · 2026-11-22 09:50 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2515) `mitsa-ng:vulkan-adreno-min-lod` → `main` · +27 −13 · 6 files · 1 commits · open Fixes #2434. ## Problem Device selection required `shaderResourceMinLod` unconditionally. Qualcomm Adreno (Windows ARM64 PRISM) never reports it, so the emulator rejected the only GPU and exited before loading a game. ## Change Downgrade the check to a logged warning, like fragmentShaderBarycentrics, and request only what the device supports at creation. The recompiler now knows the feature through `Spirv::Profile`: samples with a sampler clamp (`_cl`) skip the `MinLod` operand on devices without it, so their SPIR-V validates (the clamp is lost; explicit-LOD samples keep clamping through `FMax`, which needs no feature). The shader store header already contains the profile, so caches never mix variants. Drivers with the feature are unchanged. ## Evidence Green on Windows/Linux/macOS CI with this branch on my fork ([run 44985645244](https://github.com/mitsa-ng/KytyPS5/actions/runs/44985645244)). I have no Adreno device, so the runtime path is untested there; the degradation is the same warn-and-continue pattern the barycentric warning uses. Written with AI assistance (ZCode); built and tested by the author.
Adreno on Windows ARM64 never reports it, so device selection rejected
the only GPU. Warn and continue instead: samples with a sampler clamp
drop the MinLod operand on such devices (explicit-LOD samples keep
clamping through FMax), and the shader store header records the flag so
caches never mix variants. Drivers with the feature are unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:21:47 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-22 09:56 UTC · original

Explain Change →

Walkthrough

Vulkan device selection no longer rejects devices that lack shaderResourceMinLod. Device creation enables the feature only when supported and passes that capability into the SPIR-V profile. The profile serialization mapping includes the new field. The image emitter omits the MinLod operand when the capability is unsupported.

Suggested reviewers: nmzik, senaxx

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Moderate · up to 205d1

Devices without shaderResourceMinLod can now be selected, which is the goal of this change. The existing ImageSampleLodClamp shader test still expects MinLod emission under a profile that now disables it, so it will likely fail until the test is given a profile with the feature enabled. Fix the test profile before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Vulkan device selection no longer rejects GPUs that lack shaderResourceMinLod. It refers to issue #2434 and matches the changeset (vulkanWindow.cpp downgrades the chec…
Description check Passed The description explains the problem (device selection required shaderResourceMinLod, so Adreno GPUs on Windows ARM64 were rejected), the change (warning instead of rejection, feature-gated device cre…
Linked Issues check Passed Issue #2434 asks that shaderResourceMinLod become optional, with a fallback or warning, so Adreno X2 devices can start. The reviewed diff of src/graphics/presentation/window/vulkanWindow.cpp shows tha…
Out of Scope Changes check Passed All changed areas connect to the requirement in #2434. vulkanWindow.cpp changes the selection check and the device feature request. graphicContext.h adds the capability flag that carries the device su…
Full details: Title check

Explanation

The title names the main change: Vulkan device selection no longer rejects GPUs that lack shaderResourceMinLod. It refers to issue #2434 and matches the changeset (vulkanWindow.cpp downgrades the check to a warning, and the recompiler gains a profile flag to skip the MinLod operand).

Full details: Description check

Explanation

The description explains the problem (device selection required shaderResourceMinLod, so Adreno GPUs on Windows ARM64 were rejected), the change (warning instead of rejection, feature-gated device creation, Spirv::Profile flag that omits the MinLod operand for sampler-clamped samples), and the testing status (CI green, Adreno runtime path untested). This matches the changeset.

Full details: Linked Issues check

Explanation

Issue #2434 asks that shaderResourceMinLod become optional, with a fallback or warning, so Adreno X2 devices can start. The reviewed diff of src/graphics/presentation/window/vulkanWindow.cpp shows that device selection no longer calls check_feature for shaderResourceMinLod. It logs a warning instead. VulkanCreateDevice sets graphics.shader_resource_min_lod_enabled from supported2.features.shaderResourceMinLod and requests the feature only when the device supports it. The summary states that the SPIR-V emitter omits the MinLod operand for sampler-clamped samples when the profile flag is false, and that Serialize.h includes the new profile field, so cache variants stay separate. These changes meet the stated coding requirement. Limits: the pipelineCache.cpp and SpirvEmitter diffs could not be read (blobs unavailable), so those parts rest on the summary. The Adreno runtime path is untested, as the author states. No new automated test is evident for the fallback path.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to the requirement in #2434. vulkanWindow.cpp changes the selection check and the device feature request. graphicContext.h adds the capability flag that carries the device support state. pipelineCache.cpp copies that flag into SpirvProfile. SpirvEmitter.h and spirvEmitterImage.cpp use the flag to omit the MinLod operand when the feature is absent. Serialize.h adds the new profile field to the shader store header. The Serialize.h change is needed so that cache entries record the profile. No unrelated change was identified in the evidence available. The pipelineCache.cpp and SpirvEmitter diffs could not be read directly, so this verdict relies on the summary for those files.

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-22 09:56 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2515#issuecomment-7077472984) <!-- 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/2515?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 --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> Vulkan device selection no longer rejects devices that lack `shaderResourceMinLod`. Device creation enables the feature only when supported and passes that capability into the SPIR-V profile. The profile serialization mapping includes the new field. The image emitter omits the `MinLod` operand when the capability is unsupported. **Suggested reviewers:** `nmzik`, `senaxx` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"205d1107d502231ea2fa87be22d73e5ba73b5b23" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix · **Severity of issue fixed:** Medium <!-- 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-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Moderate</strong> · up to <code>205d1</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `205d1` --> <!-- final_review_risk_coverage:{"sourceCommitId":"205d1107d502231ea2fa87be22d73e5ba73b5b23","coveredCommitId":"205d1107d502231ea2fa87be22d73e5ba73b5b23","kind":"reviewed"} --> Devices without shaderResourceMinLod can now be selected, which is the goal of this change. The existing ImageSampleLodClamp shader test still expects MinLod emission under a profile that now disables it, so it will likely fail until the test is given a profile with the feature enabled. Fix the test profile 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</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: Vulkan device selection no longer rejects GPUs that lack shaderResourceMinLod. It refers to issue `#2434` and matches the changeset (vulkanWindow.cpp downgrades the chec… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description explains the problem (device selection required shaderResourceMinLod, so Adreno GPUs on Windows ARM64 were rejected), the change (warning instead of rejection, feature-gated device cre… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Issue `#2434` asks that shaderResourceMinLod become optional, with a fallback or warning, so Adreno X2 devices can start. The reviewed diff of src/graphics/presentation/window/vulkanWindow.cpp shows tha… | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | All changed areas connect to the requirement in `#2434`. vulkanWindow.cpp changes the selection check and the device feature request. graphicContext.h adds the capability flag that carries the device su… | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main change: Vulkan device selection no longer rejects GPUs that lack shaderResourceMinLod. It refers to issue `#2434` and matches the changeset (vulkanWindow.cpp downgrades the check to a warning, and the recompiler gains a profile flag to skip the MinLod operand). </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description explains the problem (device selection required shaderResourceMinLod, so Adreno GPUs on Windows ARM64 were rejected), the change (warning instead of rejection, feature-gated device creation, Spirv::Profile flag that omits the MinLod operand for sampler-clamped samples), and the testing status (CI green, Adreno runtime path untested). This matches the changeset. </dd> </dl> </details> <details> <summary><strong>Full details: Linked Issues check</strong></summary> <dl> <dd> <br> **Explanation** Issue `#2434` asks that shaderResourceMinLod become optional, with a fallback or warning, so Adreno X2 devices can start. The reviewed diff of src/graphics/presentation/window/vulkanWindow.cpp shows that device selection no longer calls check_feature for shaderResourceMinLod. It logs a warning instead. VulkanCreateDevice sets graphics.shader_resource_min_lod_enabled from supported2.features.shaderResourceMinLod and requests the feature only when the device supports it. The summary states that the SPIR-V emitter omits the MinLod operand for sampler-clamped samples when the profile flag is false, and that Serialize.h includes the new profile field, so cache variants stay separate. These changes meet the stated coding requirement. Limits: the pipelineCache.cpp and SpirvEmitter diffs could not be read (blobs unavailable), so those parts rest on the summary. The Adreno runtime path is untested, as the author states. No new automated test is evident for the fallback path. </dd> </dl> </details> <details> <summary><strong>Full details: Out of Scope Changes check</strong></summary> <dl> <dd> <br> **Explanation** All changed areas connect to the requirement in `#2434`. vulkanWindow.cpp changes the selection check and the device feature request. graphicContext.h adds the capability flag that carries the device support state. pipelineCache.cpp copies that flag into SpirvProfile. SpirvEmitter.h and spirvEmitterImage.cpp use the flag to omit the MinLod operand when the feature is absent. Serialize.h adds the new profile field to the shader store header. The Serialize.h change is needed so that cache entries record the profile. No unrelated change was identified in the evidence available. The pipelineCache.cpp and SpirvEmitter diffs could not be read directly, so this verdict relies on the summary for those files. </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=2515)! 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 -->
@ -15,1 +15,4 @@
bool native_float_min_max = false; // NMin/NMax give the guest's NaN and signed-zero results.
// Samples with a sampler clamp use the MinLod operand; without the feature the clamp is
// dropped (explicit-LOD samples still clamp through FMax).
bool shader_resource_min_lod = false;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-22 09:56 UTC · original

Major · Functional Correctness · Quick win

Enable the MinLod profile in ImageSampleLodClamp.

ImageSampleLodClamp uses the default Maintenance8Profile, which leaves shader_resource_min_lod false. The emitter therefore omits the MinLod operand and capability for its _cl sample. The test requires the text MinLod in the disassembly, so it fails when the sample's min_lod is nonzero. The test also expects mip 1, which requires the clamp to be kept. Give this test a profile that enables the flag.

Suggested fix

 constexpr ShaderProfile RelaxedFloatProfile{.maintenance8 = true, .relaxed_float = true};
+constexpr ShaderProfile MinLodProfile{.maintenance8 = true, .shader_resource_min_lod = true};
   TestCase test;
   test.name = "ImageSampleLodClamp";
+  test.profile = &MinLodProfile;
   test.code = std::move(code);
**@⁠coderabbitai[bot]** on GitHub · 2026-11-22 09:56 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2515#discussion_r4657612956) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Quick win** **Enable the MinLod profile in `ImageSampleLodClamp`.** `ImageSampleLodClamp` uses the default `Maintenance8Profile`, which leaves `shader_resource_min_lod` false. The emitter therefore omits the `MinLod` operand and capability for its `_cl` sample. The test requires the text `MinLod` in the disassembly, so it fails when the sample's `min_lod` is nonzero. The test also expects mip 1, which requires the clamp to be kept. Give this test a profile that enables the flag. <details> <summary>Suggested fix</summary> <dl> <dd> <br> ```diff constexpr ShaderProfile RelaxedFloatProfile{.maintenance8 = true, .relaxed_float = true}; +constexpr ShaderProfile MinLodProfile{.maintenance8 = true, .shader_resource_min_lod = true}; ``` ```diff TestCase test; test.name = "ImageSampleLodClamp"; + test.profile = &MinLodProfile; test.code = std::move(code); ``` </dd> </dl> </details> <!-- fingerprinting:phantom:poseidon:wombat61 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:700f27953cf98ec3b5624664 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-22 09:57 UTC · original · reviewed

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6133172164 and 205d1107d5.

Files selected for processing: 6

  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp
  • src/graphics/shader/recompiler/ir/Serialize.h

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-22 09:57 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2515#pullrequestreview-6011592343) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 1** <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><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</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/613317216495ad7c98ea0e3743cded89d4596062/.coderabbit.yaml>) - **Commit**: [6133172](<https://github.com/KytyPS5/KytyPS5/commit/613317216495ad7c98ea0e3743cded89d4596062>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `ae71e6cb-7f4d-4b28-95d7-b6e3dc19092a` </dd> </dl> </details> <details> <summary><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</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 613317216495ad7c98ea0e3743cded89d4596062 and 205d1107d502231ea2fa87be22d73e5ba73b5b23. </dd> </dl> </details> <details> <summary><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: 6</summary> <dl> <dd> <br> * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp` * `src/graphics/shader/recompiler/ir/Serialize.h` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=6ca628bf-70d9-4312-aa9c-a62c18fc828b attempt=1496365a-ea96-43b4-9e51-9759179be4d7 batch=1/1 -->
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2515/head:github-bot/gh-2515'
git switch 'github-bot/gh-2515'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2515'
git switch 'github-bot/gh-2515'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2515'
git switch 'github-bot/gh-2515'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2515'
git switch 'main'
git merge --squash 'github-bot/gh-2515'
git switch 'main'
git merge --ff-only 'github-bot/gh-2515'
git switch 'main'
git merge 'github-bot/gh-2515'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.