vulkan: accept devices without shaderResourceMinLod (#2434) #2515
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2515
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2515"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@mitsa-ng on GitHub · 2026-11-22 09:50 UTC · original
mitsa-ng:vulkan-adreno-min-lod→main· +27 −13 · 6 files · 1 commits · openFixes #2434.
Problem
Device selection required
shaderResourceMinLodunconditionally. 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 theMinLodoperand on devices without it, so their SPIR-V validates (the clamp is lost; explicit-LOD samples keep clamping throughFMax, 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.
@coderabbitai[bot] on GitHub · 2026-11-22 09:56 UTC · original
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 theMinLodoperand when the capability is unsupported.Suggested reviewers:
nmzik,senaxxChange: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Moderate · up to
205d1Devices 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:
4
#2434and matches the changeset (vulkanWindow.cpp downgrades the chec…#2434asks 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…#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
#2434and 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
#2434asks 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
@ -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;@coderabbitai[bot] on GitHub · 2026-11-22 09:56 UTC · original
Enable the MinLod profile in
ImageSampleLodClamp.ImageSampleLodClampuses the defaultMaintenance8Profile, which leavesshader_resource_min_lodfalse. The emitter therefore omits theMinLodoperand and capability for its_clsample. The test requires the textMinLodin the disassembly, so it fails when the sample'smin_lodis 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
@coderabbitai[bot] on GitHub · 2026-11-22 09:57 UTC · original · reviewed
Actionable comments posted: 1
ae71e6cb-7f4d-4b28-95d7-b6e3dc19092aReviewing files that changed from the base of the PR and between
6133172164and205d1107d5.src/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/presentation/window/vulkanWindow.cppsrc/graphics/shader/recompiler/backend/spirv/SpirvEmitter.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cppsrc/graphics/shader/recompiler/ir/Serialize.hIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.