feat(agc): export stencil operation values through an attachment #10351
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10351"
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?
Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-23T18:51:01Z.
What
The November 20 sync merges main
ee764ca7fd02d39182777f1abbaac3b9388efaa4. Shader cache format 106 preserves main'sdispatchThreadLimitandsplitStateLanesfields together with this PR'sstencilAttachmentExport. Format 105 is already in use by #7085. The round-trip fixture uses non-default values for the split-dispatch fields and the attachment flag and checks that entries from main's format 95 and the branch's previous format 104 are rejected.On a host without native stencil export, a pixel shader's operation value may be unsafe to replay. The bounded full-byte replace fallback copies stencil into an R8_UINT attachment at unused color location 7, draws once after late tests, then copies it back while retaining the depth owner. Native export and bounded reference replay remain supported; unsupported masks, tests, stages, layers, samples, attachment collisions and non-COPY color ROPs throw.
The branch retains main's expanded
Drawsignature andDrawResourceContentKey, its recording interface and resource-content keys, and the fallback's expanded stencil/blend state and exclusions from recipe, shape and pass-attachment memoization.The latest review fix,
5cf6fcc26bd19bf5360cfaa47fe4e12be4cc8c93, addresses review 5936706796. A color logic operation is enabled for the whole pipeline, so it would also transform the temporary R8_UINT stencil output before copy-back.ValidateStencilAttachmentnow refuses every operation except COPY, using the existingLogicOpFromRopconversion. Both supported COPY encodings remain accepted. The debt fragment lists the non-COPY refusal.The November 17 shader-cache layout retained main's format-88 fields, including
DescriptorBinding::imageUintStorage, and this PR'sstencilAttachmentExport. It used format 103. The pinned inventory covers 1,652 open PR heads with no missing cache header, finds versions through 102 and no other format-103 user. The round-trip regression rejects formats 69, 85, 88 and 91. Future compositions need a distinct version after preserving both layouts.Main requires and enables
independentBlend; #6782 and #10940 are merged. There is no open implementation prerequisite. #11551 still declares the agreed #10351 -> #11551 order. Merged #18530 changes the replay lane-set proof and replay-only late store; #19966 changes the native stencil output type. Neither implements this attachment fallback. A later composition must retainSelectStencilExportMode, consistently gate replay-only stores and preserve the native/replay/attachment output types and cache fields. Those peer compositions are not tested here.The November 19 sync integrates main
b68affac18ca39391a3800d5cb51735d085c014d. The shared export selector keeps #18530's fixed-lane replay eligibility, and the emitter allocates the late store only on the replay path when the original lane-set proof requires it. The attachment fixture now includes ans_ttracedatainstruction. The replay proof rejects that trace side effect without changing the deterministic stencil value, so all four attachment cases exercise the attachment path on devices that support the new replay mode.The November 19 merge used shader cache format 104. It keeps the current main layout and
stencilAttachmentExport. The snapshot of 2,017 open PR heads contains no format 104 and no missing cache header. The cache regression round-trips the attachment field and rejects main format 90 and the previous branch format 103, along with the existing historical versions.Tested
November 20 Windows Release validation used main
ee764ca7fd02d39182777f1abbaac3b9388efaa4and PR head2921b4482e8754dc05e57d7580b1ed4f871a3de1. The PR built the productionrelinkerandlibstargets. Both revisions built and ran the focused AGC and shader disk cache tests on Windows 11 Pro 10.0.26300 with WinLibs GCC 15.2, a Ryzen 9 7900X, 31.66 GiB RAM, and an NVIDIA GeForce RTX 4070 Ti SUPER (driver 621.24).Main passed 21 CTests and skipped one. The PR passed 25, including all four stencil attachment cases, and skipped two. The updated selection also covers
agc_driver_split_table_call_runandagc_driver_stencil_replay_unsuppressedon both revisions. The static-color-mask and pass-attachment-memo runs each passed five and skipped one. Native stencil export skipped on this GPU, and the device-level refusal for disabledindependentBlendskipped because the feature is enabled. The synthetic refusal ran in the graphics tests. Each device creation selected the same GPU and inserted Khronos validation 1.4.335. No VUID, missing validation layer, or synchronization hazard was logged. Conventions, whitespace, and the main-sync check passed.November 19 Windows Release validation used main
b68affac18ca39391a3800d5cb51735d085c014dand PR head3d9e208f9ca0a2819b574bd79b6c4dd8830c4795. Both full runtime builds passed with the same WinLibs 15.2 toolchain and RTX 4070 Ti SUPER, driver 621.24, on Windows 11 Pro 10.0.26300. Main passed 19 CTests and skipped one. The PR passed 23 and skipped two. The static-color-mask and pass-attachment-memo controls each passed five and skipped one.All four attachment cases executed. The native stencil-export case skipped on both revisions because this GPU lacks the native extension. The missing-independentBlend control skipped on the PR GPU run because the feature is enabled. The host-only push-budget case still exercised the synthetic refusal. Each device-creating test confirmed the GPU and inserted Khronos validation 1.4.335. No VUID, validation error, missing-layer or synchronization hazard was logged. The only validation notices concerned the deprecated environment setting for enabling synchronization validation.
At the publication check, main
907fe8fd315c5bdc001a043541be52675e2de9fbmerged cleanly with this head. Its intervening changes concern libSceJsc and an export-gap tool test. The validation above covers the exact built revisions. Earlier reports below retain their original revisions.November 17, 2026 (Europe/Prague): the production runtime and all candidate test configurations below were rebuilt and rerun on exact head
5cf6fcc26bd19bf5360cfaa47fe4e12be4cc8c93.The unchanged main baseline
0e925c3970dfef049da3cf75be171c4bb5e4a1f6was built and tested earlier today in this same environment; its results are reused below. No AGC or shader-recompiler source changes landed between that baseline and the refreshed maincb28e72762dad4d5b5448f30c5a7ebad3d0af56cused for the clean merge preview.Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 31.66 GiB RAM; NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.24. WinLibs GCC 15.2.0 r7 UCRT, CMake 4.3.1, Python 3.14.7. Both arms use separate full-runtime build directories, rebuilt incrementally on their exact revisions, Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON. Production relinker, all libraries and eleven focused fixture targets build, with at most three compiler jobs. Tests run serially after compilation finishes.The new state-validator regression was first built with only the test change on parent
f4eef7d472252b447265cac236676d0a6b041f58.agc_driver_stencil_ref_export_push_budgetfailed withexpected graphics rejection: refuses a color logic operation, because XOR was admitted. It passes with the guard in this head, both in the focused stencil selection and inagc_driver_graphics. This is a CPU state-validation regression. It checks XOR encodings0x5aand0x66, CLEAR and SET refusals, and COPY encodings0xccand0xf0acceptance, with the device logicOp flag enabled and disabled.All four attachment cases execute in each candidate configuration: varying values, scissor preservation, depth-fail preservation and partial-mask refusal. Native stencil export skips on this GPU. The device-level missing-independentBlend control skips because the feature is enabled; the synthetic disabled-feature refusal and acceptance execute in
agc_driver_graphicsand its focused stencil selection. Recording, submit-progress, pending-store, layered-vertex, stencil replay and the selected cache round-trip/persistence/pack/long-path/host-stderr checks pass. Every selected test finishes below 30 seconds.Both arms require Vulkan, disable ordinary application shader caches and load the same explicit Khronos validation 1.4.335, matching the pinned Vulkan headers. The verbose logs show the loader inserting
VK_LAYER_KHRONOS_validationand using the RTX 4070 Ti SUPER; there are no missing-layer messages or VUID, SYNC-HAZARD or UNASSIGNED validation IDs. Cache fixtures use isolated caches. The memo-verification control reports no attachment mismatch. Driver caches are uncontrolled; these are correctness checks. No new title, console, other-vendor or Linux-runtime result is claimed.Conventions and whitespace checks pass. The current-main merge preview is clean: this head is 9 commits ahead and 104 behind the fetched main
cb28e72762dad4d5b5448f30c5a7ebad3d0af56c, with merge base0e925c3970dfef049da3cf75be171c4bb5e4a1f6.The earlier overlap scan for parent
f4eef7d472252b447265cac236676d0a6b041f58checked 1,652 open heads and exited 2: 31 confirmed peer overlap rows and 97 incomplete comparisons against conflicting branches, excluding this PR's own previous head. The review fix changes only the existing validator, its existing test block and its debt fragment, and adds no exports. The declared #10351 -> #11551 order is retained. No complete clean overlap result or tested peer stack is claimed.Reproduction with the supported toolchain on
PATH, from separate checkouts/build directories for each revision:From the candidate checkout:
C:/Python314/python.exe tools/check_conventions.py --base origin/main,C:/Python314/python.exe tools/check_main_sync.py --base origin/main, andgit diff --check origin/main...HEAD. The earlier overlap report is retained with its pinned scope and limitations above. New hosted full-build CI requires a maintainer to dispatchbuild.ymlwithpr=10351; local results are separate from hosted CI.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T19:31:07Z.
Review: APPROVED
Reviewed head 5fb1167da35542c96ed61faa6e1c971c5691798b. The fallback is narrowly gated to the supported full-byte replace case, preserves the pre-draw stencil for uncovered/depth-failed pixels, and rejects partial masks and the documented unsupported state combinations. The added runtime fixtures exercise varying output values, scissor preservation, depth failure, and explicit refusal; reported Windows validation is detailed and includes the dependent independent-blend PR. I did not run the GPU tests locally. I found no blocking issue in the reviewed diff.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T16:47:56Z.
Review: CHANGES_REQUESTED
Blocking Vulkan feature omission in the new attachment fallback:
ValidateStencilAttachmentaccepts the path without checkingindependentBlend, whileVulkanDevice.cppleavesenabled.independentBlendfalse. The fallback then setsmasked->blends[7].colorWriteMasktoVK_COLOR_COMPONENT_R_BITand submits the full attachment-state array throughPipeline.cpp. This differs from the other attachment states in ordinary draws, so pipeline creation violates Vulkan VUIDVUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605whenindependentBlendis not enabled. The Khronos spec says allpAttachmentselements must be identical without that feature: https://registry.khronos.org/VulkanSC/specs/1.0-extensions/man/html/VkPipelineColorBlendStateCreateInfo.htmlPlease either query and enable
independentBlendwhen supported and reject this fallback on devices where it is unavailable, or restructure the fallback so the color blend attachment states remain identical. Add a validation or regression test for the unsupported-feature case; this path currently has no feature guard. The existing hosted checks are policy/convention checks; graphics build and device execution are skipped for this path, so they do not exercise pipeline creation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T22:18:25Z.
Review: APPROVED
Reviewed updated head
be104dae9cd53deed979cffe1699c2e111f136e3. The newindependentBlendcheck is wired from the enabled Vulkan device feature intoContextand rejects the attachment fallback before pipeline creation when the feature is disabled; the graphics regression covers both rejection and acceptance cases. This addresses the VUID blocking issue from my prior review. The PR reports the focused Windows/Vulkan test set and dependency-composed fallback cases passing with validation enabled and noVUID-lines. I verified conventions against currentmain,git diff --check, and a strict main-sync preview: the PR is 5 commits behind and 2 ahead, and the merge-tree is clean. The feature-enabling dependency #6782 is still open and currentmaindoes not enableindependentBlend, so merge this after #6782 and refresh the base as needed. The Demon's Souls run on this head proceeds past stencil export and later reaches a write fault; that is separate evidence and does not change this review.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:17:43Z.
Review: CHANGES_REQUESTED
Re-check — changes requested\n\nI read the new Linux NVIDIA report and compared it with the PR's declared dependency and validation record. This run tested on without #6782, while this PR explicitly requires #6782 to enable . All four new tests stop at with the expected refusal; the report therefore does not show the fallback succeeding, but it also does not demonstrate a regression in the declared #6782 → #10351 composition. The PR description's separate RTX 4070 Ti SUPER composition with #6782 reports all four cases passing with validation enabled.\n\nThe PR is still based on , while current upstream main is . Please restack onto current main, preserve the declared #6782 dependency/order, and rerun the focused suite on the exact current-main + #6782 + this-PR composition. Keep the no-#6782 refusal as a negative control, but make the automated run skip/partition that dependency-only case so the branch's required integration test does not report four misleading failures when the prerequisite is absent. The existing integrated test report is author-provided; I did not run the GPU suite locally.\n\nI am not treating the no-dependency run as proof that the fallback is broken. The current-main refresh and exact prerequisite composition are still needed before merge.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:18:01Z.
Review: CHANGES_REQUESTED
Correction and re-check — changes requested
Formatting in my preceding review stripped several inline identifiers. The intended assessment is:
I read the new Linux NVIDIA report and compared it with the PR's declared dependency and validation record. This run tested head f77e95e on base
52c09d5without #6782, while this PR explicitly requires #6782 to enable independentBlend. All four new tests stop at ValidateStencilAttachment with the expected “enabled independentBlend” refusal. The report therefore does not show the fallback succeeding, but it also does not demonstrate a regression in the declared #6782 → #10351 composition. The PR description's separate RTX 4070 Ti SUPER composition with #6782 reports all four cases passing with validation enabled.The PR is still based on
17f8dfad, while current upstream main isaaccd0ba. Please restack onto current main, preserve the declared #6782 dependency/order, and rerun the focused suite on the exact current-main + #6782 + this-PR composition. Keep the no-#6782 refusal as a negative control, but make the automated run skip or partition that dependency-only case so the branch's required integration test does not report four misleading failures when the prerequisite is absent. The existing integrated test report is author-provided; I did not run the GPU suite locally.I am not treating the no-dependency run as proof that the fallback is broken. The current-main refresh and exact prerequisite composition are still needed before merge.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T08:41:53Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed implementation and supplied validation support merging.
What I ran
14dc7f17e7156dac19c67033952ea23605c30314using the preparedreview/diff.patchand the pinnedrepo_read.pyreader.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
included: trueinreview/manifest.json:Context.hpp,Draw.hpp,Draw.cpp,Pipeline.cpp,ShaderValidation.cpp,Graphics.cpp,ShaderDiskCache.cpp,agc_driver_stencil_ref_export_unused_tests.cmake,StencilRefExportUnused.cpp,Recompiler.cpp,Recompiler.hpp,ShaderDiskCache.hpp,SpirvEmitterState.hpp,SpirvEmitterHelpers.cpp,SpirvModuleEmitter.cpp,StencilReplay.cpp,StencilReplay.hpp, andlibSceAgcDriver.md.VulkanDevice.cppandGraphics.cppwere excluded from the review folder because they were too large; I read the relevant ranges through the reader. No other changed files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T20:42:14Z.
Review: COMMENTED
Reviewed — comments
The focused review found no verified blocking defect, but two changed files were only inspected at their relevant hunks, so the evidence does not support a formal approval.
What I ran
Reviewed head
8842165642129a27681929e6f7ac59dbd9049fa1. No build or tests were run; the checks described in the PR body are author-reported. Inspected the prepared description, commits, manifest, diff, and relevant changed code and callers.Results
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Not verified
The full text of
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded from the review folder; only relevant ranges were read throughrepo_read.py. No independent build, tests, or CI results were run or confirmed. Other changed-file contents were inspected through the prepared diff and targeted ranges, not read in full.To get this to a good state
Nothing is required. Optional: complete a full-file review of the two files listed above before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T10:24:09Z.
Review: CHANGES_REQUESTED
feat(agc): export stencil operation values through an attachment — changes requested
Changes are required before merge: refuse non-COPY color logic operations in the stencil attachment fallback, because they corrupt the exported stencil value.
What I ran
f4eef7d472252b447265cac236676d0a6b041f58, basemain.description.md,commits.md,manifest.jsonand all hunks ofdiff.patch.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:3185:ValidateStencilAttachmentaccepts a non-COPY color ROP, so a guest draw with, for example, an XOR color ROP writes the wrong stencil value.Pipeline.cppsetslogicOpEnableon the one blend state for the whole pipeline when the color ROP is not COPY (core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp:773). The fallback resizes the blend list to eight entries (core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:4359), and the attachment count follows that list (Pipeline.cpp:749,Pipeline.cpp:777). So location 7 receivesop(value, loaded stencil)instead ofvalue.Storethen copies that combined value back into stencil.logicOp, a draw with an XOR color ROP, and an exported operation value. The copied-in stencil is combined with the exported value, and the copy-back stores the wrong result.Require(LogicOpFromRop(state.colorRop) == VK_LOGIC_OP_COPY, "stencil attachment export refuses a color logic operation");, ifLogicOpFromRopis visible inDraw.cpp. Add a refusal case to the test that already covers independentBlend incore/libs/prx/libSceAgcDriver/tests/Graphics.cpp.Non-blocking
docs/dev/debt/changes/pr10351-stencil-attachment.md:5: the debt note lists the refusals (rect lists, mesh and tessellation, face and channel splits, partial masks). Add the color logic-operation refusal when the fix lands.Not verified
LoadandStore(core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:3159) read and write the depth image inVK_IMAGE_LAYOUT_GENERAL. I did not confirm that layout against the render pass.VulkanDevice.cppandtests/Graphics.cppare too large for the review folder. I read only their changed hunks fromdiff.patch, plus the reader lookup above.Sources
To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T15:19:11Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional. I found no verified blocking defect in the diff, but I did not read the full text of the changed files, so this is a comment rather than an approval.
What I ran
5cf6fcc26bd19bf5360cfaa47fe4e12be4cc8c93. Base:main. I did not run the merge preview.description.md,commits.md,manifest.json,diff.patch.repo_read.py searchinGraphics/src/Draw.cpp(masked,targetViews) and inGraphics/(DepthSampleLocations).Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:3880:shaders.back().program->stencilAttachmentExportis dereferenced after only a stage check. If a fragment-stage entry with a nullprogramever reached this point, it would crash. The same unchecked pattern is used inPipeline.cpp:841, so this may be acceptable; a null guard would make it explicit.Not verified
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Graphics.cppwere read only as diff hunks.Draw.cpp(about 5,258 lines),Pipeline.cpp,ShaderValidation.cpp,StencilReplay.cpp,Recompiler.cpp,SpirvModuleEmitter.cpp, and the test files.Draw.cpp:3134–3199): I did not confirm that the depth image is inVK_IMAGE_LAYOUT_GENERALat both copies, or that the R8_UINT target has the transfer usage flags it needs.Draw.cpp:4358appends the stencil color withexportIndex7. I did not confirm how the pipeline maps render-pass attachment indices to blend state when fewer than seven color targets exist.prepared.stencilTarget(Draw.cpp:4157) outlives the recorded and submitted commands.To get this to a good state
Nothing is required.
Optional: add a null guard at
Draw.cpp:3880, or state whyprogramcannot be null there.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T12:00:49Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
3d9e208f9ca0a2819b574bd79b6c4dd8830c4795. I read the prepared description, commits, manifest, and diff, then inspected the attachment validation and recording path, shader mode selection and emission, cache format, and the focused attachment fixture. I did not run commands or tests; the description reports Windows Release validation on this head.Results
Findings
Blocking
None found in the inspected code.
Non-blocking
StencilAttachment::Colorsizes the temporary image and transfer buffer from the full depth extent, while the draw area is validated only to fit within that extent (Draw.cpp:3223,Draw.cpp:3272). The current fixture covers a smaller scissor area and confirms preservation; an explicit test for a render extent smaller than the depth target would strengthen coverage of untouched pixels outside the render area.Not verified
VulkanDevice.cpporGraphics.cpp; these were excluded from the review folder because they are too large. I inspected only targeted ranges ofVulkanDevice.cppandGraphics.cpp, plus their relevant changed hunks indiff.patch.diff.patch. Tests, builds, other operating systems, other GPUs, and console behavior were not run or independently confirmed.To get this to a good state
Nothing is required. Optional: add an attachment test that draws into a render area smaller than the depth target and checks stencil preservation outside that area.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:19:02Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
2921b4482e8754dc05e57d7580b1ed4f871a3de1. I did not run commands or tests;repo_read.pywas used to inspect the prepared diff and targeted source ranges. The description reports Windows 11 build and test results, which I did not independently run.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_stencil_ref_export_unused_tests.cmake:2Not verified
Full text was read for all changed files marked
included: truein the manifest exceptcore/libs/prx/libSceAgcDriver/tests/Graphics.cpp, which is excluded as too large; the relevant test hunks were inspected indiff.patch. The changed files excluded from the review folder werecore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Graphics.cpp; the Vulkan setup hunks in the former were read throughrepo_read.py. No repository tests, build, or physical console behavior were independently verified.To get this to a good state
Nothing is required. Optionally confirm the new CMake fragment is wired into the test configuration.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T07:57:25Z.
Review: COMMENTED
Reviewed — comments
The review covers the prepared diff at head
23fad661a575a700e456e604ab6a14a58f168e8d; no blocking defect was verified, but the review is incomplete, so a formal approval is not justified.What I ran
Read the prepared description, commits, manifest, complete diff, and targeted source excerpts using the review reader. No build or tests were run in this review; validation results in the description are author-reported.
Results
Negative control
Not run in this review. The description reports a prior test that failed before the logic-operation guard and passed with it; that report was not independently verified.
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Not verified
Full source text was not read for every changed file. The two changed files excluded from the review folder were
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Graphics.cpp; targeted excerpts from the first were read through the reader, but the second was not read. For included files, review was limited to changed hunks and targeted surrounding excerpts rather than each full file. No tests or build were run.To get this to a good state
Nothing is required. Optional: complete the source review of the unread changed test file and run the focused checks on this exact head before treating the review as complete.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T09:26:26Z.
Review: DISMISSED
Reviewed — changes requested
Changes are required before merge: reject depth/stencil feedback reads on the stencil attachment path before copying the stencil plane into its temporary color attachment.
What I ran
Reviewed head
01a4c901196f3a3e6422f75671cd3e62c6d90cde. No commands or tests were run; author-reported validation is not a run performed in this review.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:4014selects the attachment fallback, but the post-resolve feedback guard atDraw.cpp:4323runs only whenstencilReferencesis non-empty. In attachment mode that vector is empty, even thoughStencilAttachment::Loadcopies stencil into an R8_UINT target andStorewrites it back to the same depth/stencil surface. A shader that samples that surface can therefore have its stencil input overwritten by the final copy-back, changing guest-visible memory and potentially conflicting with shader access. Apply the existing depth/stencil overlap checks tostencilAttachmentas well, or reject such overlap before recording the draw.Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Graphics.cpp; their diffs and targeted reader ranges were inspected. Other changed files’ added lines and relevant code were reviewed.To get this to a good state
Reject depth/stencil feedback reads in attachment mode before recording the draw, then rerun the focused stencil attachment tests and graphics suite on the updated head.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.