graphics: use static feedback loop pipelines without the dynamic-state extension #2213
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!2213
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2213/head"
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?
@theantipopau on GitHub · 2026-11-11 10:43 UTC · original
theantipopau:fix/static-feedback-loop-rebase→main· +168 −43 · 9 files · 6 commits · closed without mergingSummary
This is a rebased replacement for #1187. It keeps the original static feedback-loop design but brings it onto current
mainand adds the layout-only test split requested during review.VK_EXT_attachment_feedback_loop_layoutindependently ofVK_EXT_attachment_feedback_loop_dynamic_state.VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXTinto the graphics pipeline key and enables the feedback-loop layout for the attachment.kDepthFeedbackharness profile and--depth-feedback-static-onlyselector, including the layout-only/static pipeline path.Supersedes #1187.
Validation
Built
shader_recompiler_compute_testson Windows and ran the static selector under Khronos Validation Layer1.4.357.0on an AMD Radeon RX 9070 XT:Exit status
0; zeroValidation Errorlines and zero VUIDs. The loader inserted the validation layer as both an instance and device layer.git diff --checkis clean and the touched test file remains CRLF.The full strict suite cannot start on this machine because the AMD driver reports
robustStorageBufferAccessSizeAlignment = 4, while the strict harness requires byte-granular alignment1. That is a pre-existing device-capability gate; the dedicated selector uses the opt-in depth-feedback profile and passes cleanly.@coderabbitai[bot] on GitHub · 2026-11-11 10:47 UTC · original · edited 2026-11-13 20:51 UTC
Walkthrough
The changes separate Vulkan attachment feedback-loop layout support from dynamic-state support. Draw execution now passes depth-attachment feedback state to pipeline lookup, which selects static pipeline feedback state when dynamic state is unavailable. Pipeline creation and dynamic commands check their respective support flags. The Vulkan test harness adds a depth-feedback profile and a static-only test path.
Suggested reviewers:
nmzikChange: Feature
Merge Risk:
High · previous review
1ebdcThe feedback-loop change itself is coherent, but the test harness now enables robustness features without enabling the extensions that provide them. That can make device creation fail or leave null descriptors unavailable in the test harness. Several earlier concerns in other files, including possible compile errors, also remain open, so this should be fixed before merge.
Pre-merge checks:
4
#1187. It lists the main changes: enabling the layout extension independently of the dynamic-state extension, tracking dynamic-state suppo…Full details: Title check
Explanation
The title names the main change: graphics pipelines use static feedback-loop state when the attachment feedback-loop dynamic-state extension is unavailable. The changeset adds the static pipeline key flag, separates layout and dynamic-state tracking, and updates device feature enablement to match. The title is specific and concise, and it is 10 words and 80 characters, which is within a reasonable length.
Full details: Description check
Explanation
The description states that this is a rebased replacement for
#1187. It lists the main changes: enabling the layout extension independently of the dynamic-state extension, tracking dynamic-state support separately, baking the depth/stencil feedback-loop flag into the pipeline key, and adding the kDepthFeedback harness profile and selector. It also reports validation results. It is directly related to the changeset.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
@ -80,0 +80,4 @@// Static VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT, used when// the host cannot enable attachment feedback loops per draw. A uint32_t keeps the packed// key aligned for its raw-byte hash.uint32_t depth_stencil_feedback_loop = 0;@coderabbitai[bot] on GitHub · 2026-11-11 10:48 UTC · original · edited 2026-11-11 20:16 UTC
Include feedback-loop support in shader-store compatibility checks.
This field persists a host-dependent pipeline requirement.
pipelineSerialization.cpp, Lines 237–244 and Lines 276–283, restores and stores the complete key. Its header at Lines 61–68 does not include feedback-loop support.SpirvProfilealso omits that support. (raw.githubusercontent.com)If a user switches from a layout-capable device to an unsupported device with the same header inputs, warm-up restores a nonzero field. The new check in
shaders.cpp, Line 356, then terminates startup until the user removes the shader store.Include the capability in the store header, or skip incompatible pipeline records during warm-up.
✅ Addressed in commit 0aa25f9
@coderabbitai[bot] on GitHub · 2026-11-11 10:48 UTC · original · reviewed
Actionable comments posted: 1
879e4950-4719-4ce5-8a7e-ce512cfdd695Reviewing files that changed from the base of the PR and between
bc934ef034and 252e2aa37793cc7c47b953eaf0f79f794474b2d0.src/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/renderer/dynamicState.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.hsrc/graphics/host_gpu/renderer/pipeline/shaders.cppsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/presentation/window/vulkanWindow.cpptests/ShaderRecompilerComputeTests.cppIncluded 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-11 10:59 UTC · original · reviewed
460af277-0c67-4e5c-93e2-948966a099f6Reviewing files that changed from the base of the PR and between 252e2aa37793cc7c47b953eaf0f79f794474b2d0 and 4eb2af7be94abf5c1b19f24323fddcf90401b794.
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.hsrc/graphics/host_gpu/renderer/renderDraw.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/graphics/host_gpu/renderer/pipeline/descriptors.cppline 68 (outdated):Resolve sampler descriptors through
snapshot_index.pair.samplerindexesprogram.info.samplers, not necessarilysnapshot.samplers. Native filtering and border variants share the original runtime descriptor throughSamplerResource::snapshot_index.PrepareBindingsuses that mapping at Line 745.For such a variant, this lookup can decode another sampler's color flags. If the variant index exceeds the snapshot size, it instead disables the color override. Both paths can select the wrong sRGB or unorm view.
Resolve
program.info.samplers[pair.sampler].snapshot_index, validate that snapshot index, and decode its descriptor.@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cppline 226 (outdated):Declare the helper functions that
EmitF32ToF16RneBitscalls.spirvEmitterAluHelpers.cppis compiled as its own translation unit through thespirv/*.cppglob inCMakeLists.txt:233. Three names used there are not visible to that unit:EmitF32ToF16RtzBits(line 226) is defined atspirvEmitterAlu.cpp:70, inside the unnamed namespace that spans lines 6–140. It has internal linkage.EmitShiftRightConstant(line 230) andEmitSubConstantMinusU32(line 251) have no declaration or definition anywhere in the repository.These undeclared identifiers stop compilation of the file. Because the glob includes it, the emulator target cannot build.
Move
EmitF32ToF16RtzBitsout of the unnamed namespace, and declare it inspirvEmitterInternal.hbeside the otherEmit*helpers. DefineEmitShiftRightConstantandEmitSubConstantMinusU32with the sameEmitterState&signature convention as the other helpers, or replace these two calls with existing helpers.@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.hline 46 (outdated):Update the
PackHalf2x16structural check in the float16 buffer-store fixture.BufferStoreFormatXyzwFloat16ConvertsComponentsrequiresPackHalf2x16in the disassembly. The buffer-store path now reaches the newEmitPackHalf2x16, which emitsOpCompositeExtract, the RNE bit conversion,OpShiftLeftLogical, and an OR. It does not emit the GLSL extended instruction. The check therefore fails even when the packed values are correct.Keep the image-path expectations at lines 37484 and 38214 unchanged. The image path still emits
GLSLstd450PackHalf2x16directly atspirvEmitterImage.cpp:272.Replace the structural check with an instruction that the new helper emits:
Suggested fix
@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/graphics/shader/recompiler/frontend/translate/Vector.cppline 288 (outdated):Pass
truefor theV_CMPX_LG_F64EXEC update.This case passes
cmpx=false.EmitCompareResulttherefore callsWriteMaskinstead of updating the per-lane EXEC predicate and both EXEC words. If the operands are equal, lanes that should become inactive can continue executing subsequent shader operations.Proposed fix
Committable suggestion
@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/graphics/shader/recompiler/ir/passes/SrtWalker.cppline 750 (outdated):Use the checked specialization reader for captured ordinary reads.
When
capture_readsis true,MaterializeResourceswalks withcapture.ObservedRuntime()(ResourceMaterialization.cpp:1688).ObservedRuntimealways installsReadOrdinaryasread_memory(SrtWalker.cpp:24). The raw-read path therefore takes the ordinary branch, and the checked specialization fallback inEvaluateRawRead(SrtWalker.cpp:748-749) is not reached.If the source provides a specialization reader but no ordinary reader,
ReadOrdinaryfalls through tostd::memcpyfrom the guest address (SrtWalker.cpp:39-42). An unmapped table address can fault the host instead of returning false. Other code in this change selects the specialization reader for this case (ResourceMaterialization.cpp:199-200).Use the specialization reader inside
ReadOrdinarywhen no ordinary reader is present. Call the raw specialization reader, notReadStrict, so the range is recorded once.Suggested fix
@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/dialog.cppline 918 (outdated):Make running termination leave the browser uninitialized.
Initialize → Open → Terminatereturns success but leavesg_web.statusasWEB_STATUS_FINISHED.CloseWebBrowserRunningnever setsWEB_STATUS_NONE. A subsequentInitializetherefore returns already-initialized, andOpenremains permitted after termination. Complete the transition to NONE while preserving the close notification.@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/dialog.cppline 949 (outdated):Keep state validation and the RUNNING transition under one lock.
After
Openreleases the first lock, another call can terminate the initialized browser. This call then acquires the second lock and changes NONE to RUNNING without initialization. Two concurrentOpencalls can also both pass validation and return success for one session. Retain one lock through validation and state mutation, or repeat validation after reacquiring it.@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/libKernel.cppline 2299 (outdated):Convert filesystem errors for the POSIX exports.
If the source path does not exist,
KernelRenameandKernelRmdirreturnKERNEL_ERROR_ENOENTwithout setting POSIX errno. These direct registrations expose that kernel error instead of-1, which breaks POSIX error handling. Add wrappers that usePOSIX_CALL, as the neighboring filesystem exports do. Seesrc/kernel/fileSystem.cpp, Lines 1355–1384 and 1468–1490, at the reviewed revision. (raw.githubusercontent.com)@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/libKernel.cppline 2300 (outdated):Keep the existing POSIX shutdown registration.
This NID already maps to
Posix::shutdownat Line 2273.SymbolDatabase::Addreplaces that mapping with this registration.LibNet::NetShutdownconverts failures intoNET_ERROR_*values, so POSIX callers no longer receive-1. Remove this duplicate registration. The relevant implementations are insrc/loader/symbolDatabase.cpp, Lines 29–35, andsrc/libs/libNet.cpp, Lines 72–73 and 97–98, at the reviewed revision. (raw.githubusercontent.com)@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/libNet.cppline 1963 (outdated):Remove one of the two
InitNet_1_NpEntitlementAccessdefinitions.src/libs/libNet.cpp:1963andsrc/libs/libNpEntitlementAccess.cpp:492both defineLibs::LibNpEntitlementAccess::InitNet_1_NpEntitlementAccesswith external linkage. The CMake glob compiles both files into the emulator target. The link then fails with a multiple-definition error.Keep one initializer. Register the new entitlement functions in the initializer that owns the
LibNpEntitlementAccessimplementation.@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/network.cppline 1278 (outdated):Check each length before adding it to
total.Two non-null iovecs with lengths
16andUINT64_MAX - 7pass this validation: the second addition wrapstotalto8.Sendmsgthen allocates eight bytes and copies sixteen bytes into that allocation before attempting the second copy. Reject a length greater thanINT32_MAX - totalbefore the addition.@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/network.cppline 2622 (outdated):Use
state.transportto select receive flags.Recvfromdeclaresstate, but it does not declaretransport. This expression preventsnetwork.cppfrom compiling on every platform.Proposed fix
Committable suggestion
@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/network.cppline 2786 (outdated):Honor
MSG_DONTWAITfor Windows datagram receives.On Windows,
ConvertMessageFlagsremoves guestMSG_DONTWAITwithout producing a host flag. Only the stream branch handles the flag separately. If a blocking UDP socket has no queued datagram, these native calls therefore wait instead of returningEWOULDBLOCK. Implement per-call nonblocking behavior for this branch without changing the socket mode observed by concurrent callers. Winsock documents that an empty blocking receive waits for data. (learn.microsoft.com)@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
src/libs/network.cppline 2817 (outdated):Report truncated datagrams through
msg_flags.If a datagram exceeds the total iovec capacity, this function returns its prefix and sets
msg_flagsto zero. The guest cannot distinguish that prefix from a complete datagram. The BSDrecvmsgcontract requiresMSG_TRUNCwhen trailing datagram data is discarded. Preserve that information on Windows when handlingWSAEMSGSIZE; use a receive API that exposes truncation on other hosts. (raw.githubusercontent.com)@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original
On
tests/ResourceTrackingTests.cppline 8449 (outdated):Replace
block_infowith the block pointers the fixture uses.Programhas noblock_infomember. The declaration atShaderIR.h:711-737contains onlyblock_storageandblocks, and no other declaration insrcortestsdefines it. These writes therefore fail to compile intests/ResourceTrackingTests.cpp.Fixture::PlanAndTrackalso reads conditions fromprogram.blocks, so terminators and conditions must be set on the block objects.Set them on the
entry,optional, anddoneblocks, as the surrounding test and existing fixtures do:Suggested fix
@coderabbitai[bot] on GitHub · 2026-11-13 04:39 UTC · original · reviewed
Actionable comments posted: 15
24568a0d-d1a1-473e-8420-7beb1d8a21efReviewing files that changed from the base of the PR and between 0aa25f98665982c2ae181d03b55bfb00eb9f6575 and da94befdaf3550fe361b74b52f7d61e4bc4c69f1.
CMakeLists.txtREADME.mddocs/agc-nid-research.mdsrc/common/abi.hsrc/common/platform/sysLinuxFileIO.cppsrc/common/platform/sysWindowsFileIO.cppsrc/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/host_gpu/renderer/masterSemaphore.cppsrc/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/host_gpu/renderer/pipeline/descriptors.hsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.hsrc/graphics/host_gpu/renderer/pipeline/shaders.cppsrc/graphics/host_gpu/renderer/render.hsrc/graphics/host_gpu/renderer/renderContext.cppsrc/graphics/host_gpu/renderer/renderContext.hsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/presentation/systemOverlay.cppsrc/graphics/presentation/window/vulkanWindow.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.hsrc/graphics/shader/recompiler/frontend/translate/Compare.cppsrc/graphics/shader/recompiler/frontend/translate/Translator.hsrc/graphics/shader/recompiler/frontend/translate/Vector.cppsrc/graphics/shader/recompiler/ir/ResourceSnapshot.hsrc/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppsrc/graphics/shader/recompiler/ir/passes/ResourceTracking.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.cppsrc/kernel/fileSystem.cppsrc/kernel/memory.cppsrc/kernel/semaphore.cppsrc/launcher/forms/configuration_list_widget.uisrc/launcher/forms/main_dialog.uisrc/launcher/include/bootSplash.hsrc/launcher/include/mainDialog.hsrc/launcher/src/bootSplash.cppsrc/launcher/src/launcherTheme.cppsrc/launcher/src/main.cppsrc/launcher/src/mainDialog.cppsrc/launcher/styles/launcher.qsssrc/libs/dialog.cppsrc/libs/dialog.hsrc/libs/libKernel.cppsrc/libs/libNet.cppsrc/libs/libSystemService.cppsrc/libs/libWebBrowserDialog.cppsrc/libs/network.cppsrc/libs/network.hsrc/libs/systemService.hsrc/loader/symbolDatabase.cppsrc/loader/symbolDatabase.htests/KernelFileSystemTests.cpptests/ResourceMaterializationTests.cpptests/ResourceTrackingTests.cpptests/ShaderRecompilerComputeTests.cpptests/StubImportCoverageTests.cpptests/VirtualMemoryAllocationTests.cpptests/WindowsFileReadTests.cpptests/shaderCfgTests.cpptests/stubImportBaseline.txtIncluded 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-13 04:51 UTC · original · reviewed
Actionable comments posted: 1
98a8adf7-6055-4d6b-9b08-e1064a6ee389Reviewing files that changed from the base of the PR and between da94befdaf3550fe361b74b52f7d61e4bc4c69f1 and
1ebdce1dce.src/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.hsrc/graphics/host_gpu/renderer/pipeline/pipelineSerialization.cppsrc/graphics/host_gpu/renderer/pipeline/shaders.cppsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/presentation/window/vulkanWindow.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@ -23933,4 +23993,3 @@VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME,VK_EXT_ROBUSTNESS_2_EXTENSION_NAME,VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME,VK_KHR_MAINTENANCE_8_EXTENSION_NAME,@coderabbitai[bot] on GitHub · 2026-11-13 04:51 UTC · original · edited 2026-11-13 20:49 UTC
Restore the required robustness extensions.
Both profiles still request
robustness2.nullDescriptor. The strict profile also requestspipeline_robustness.pipelineRobustness. However, the extension list now reachesvkCreateDevicewithout either robustness extension. (raw.githubusercontent.com)Device-level extension functionality requires extension enablement.
VK_EXT_robustness2is not core functionality, and pipeline robustness became core only in Vulkan 1.4. Removing these names therefore leaves null-descriptor use unsupported by the enabled extensions and breaks strict-profile robustness on Vulkan 1.3 devices. (docs.vulkan.org)Restore
VK_EXT_ROBUSTNESS_2_EXTENSION_NAMEfor both profiles. EnableVK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAMEwhenRequiresRobustAccess()is true unless the harness explicitly uses its core equivalent.✅ Addressed in commits
9a9bfbeto ec55b70@theantipopau on GitHub · 2026-11-13 20:40 UTC · original
Status: rebased onto current
main. Local--depth-feedback-static-onlyselector passes, and Windows/macOS/Linux CI is green. The PR is CLEAN/MERGEABLE. The fork account cannot merge it (GitHub rejectsMergePullRequestfor lack of permission), so a maintainer needs to merge.Pull request closed