fix(agc): clamp depth exports per viewport #23553
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23553"
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 malekaifa on 2026-11-19T08:08:34Z.
What
PA_SC_VPORT_ZMIN/PA_SC_VPORT_ZMAXbounds and propagate them through draw state and shader cache identity.multiViewportis enabled and viewports have distinct bounds, read the fragmentViewportIndexbuilt-in and clamp exportedFragDepthusing the rasterized viewport's own bounds.DISABLE_VIEWPORT_CLAMPsemantics.Tested
1b8f79a5b5; rebased head436dd13865. Main subsequently advanced to0f107f9812via #26699; its 38 changed paths do not overlap this PR's 22 changed paths, and GitHub reports the PR mergeable.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)Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-19T08:08:43Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T15:32:31Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at
2d6fb6f128942627c41f70b998754004183d6a6cappears sound from the code inspected; no checks were run independently.What I ran
No commands were run. I read the prepared description, commits, manifest and diff, then inspected targeted source and test ranges through
repo_read.pyat the pinned head.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded because it exceeded the review-folder limit. I read its changed lines indiff.patch, but did not inspect the full file. Build, tests, Vulkan runtime behavior, and author-reported environment/results were not independently verified. Other changed files listed as included in the manifest were read selectively at relevant ranges, not in full.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T04:45:48Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
19bc2741a025b4c505ed9c53aa1a15ca366384b3using the prepared diff, manifest, and pinned repository reader. No build or test commands were run; test results below are author-reported.Results
Findings
Blocking
None in the source inspected.
Non-blocking
None.
Sources
Reviewed
description.md,commits.md,manifest.json, anddiff.patch. Read the included changed filesDrawDecode.cpp,DrawLookup.cpp,DrawRegisterKey.cpp,ShaderRegistry.cpp,Pipeline.hpp,ShaderInputState.hpp,State.hpp,Draw.cpp,ShaderInputState.cpp,ShaderValidation.cpp,CacheKey.hpp,RequestSerializer.cpp, andSpirvModuleEmitter.cppin part. Also read the manifest and changed-file listing.Not verified
The full text of
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded as too large. Other changed files listed in the manifest were not read, including the execution regression test and several recompiler, serializer, and SPIR-V helper files. No tests were run during this review, so author-reported results were not independently confirmed.files.jsonwas not available through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T19:28:53Z.
Review: COMMENTED
Reviewed — no blocking findings
No blocking defect was verified in the inspected changes; the review is incomplete for a formal approval because I did not run the checks or inspect every changed file’s full source.
What I ran
Head:
d3451d6f13252ce695df11bb622e60609fea5855. No commands or tests were run. I read the prepared description, commit list, manifest, diff, and targeted source ranges throughrepo_read.py. The author reports Windows 11 / RTX 5080 focused tests passing; these were not run by me.Results
Negative control
Not run; no assertion or test mutation was performed.
Findings
Blocking
None verified in the inspected changes.
Non-blocking
No code-level optional feedback identified from the inspected ranges.
Sources
Reviewed the prepared diff and head-pinned source ranges for viewport depth-bound decoding, shader input and clamp emission, cache identity, request serialization, and related tests. The files reviewed are the changed files listed in the manifest.
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded from the review folder because it exceeded the size limit; relevant changed ranges were read through the repository reader. Full source text for other changed files was not read where targeted ranges sufficed.Not verified
Builds, tests, runtime behavior, and the author's reported validation were not independently verified. I did not inspect every changed file's complete source; review coverage was based on the prepared diff and targeted source ranges.
To get this to a good state
Nothing is required. Optional: independently run the focused test suite and inspect the remaining changed-file context before treating this review as complete.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T23:03:14Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed source paths show coherent per-viewport depth clamp propagation, but one changed test file was excluded from inspection, so the review is incomplete for approval.
What I ran
3317cc85a8a82ab7d842a6d77271d6cd725def9ausingrepo_read.py.Results
Findings
Blocking
None verified.
Non-blocking
None.
Sources
Reviewed the prepared description, commits, manifest, and diff, plus the changed source paths for viewport depth decoding, shader validation and emission, cache identity, and request serialization.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded because it was too large for the review folder and was not read through the reader. Other changed files were not all read in full. The author-reported test results were not independently run.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T23:34:43Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review artifacts and targeted code read support the stated per-viewport depth-clamp behavior, and no checks were run by me.
What I ran
Reviewed head
5aaf19563738f6d7e0faa816b4609c2c88fcc05fusing the prepared diff and the pinnedrepo_read.pyreader. No build or tests were run by me. The author-reported test results are not independently verified.Results
Findings
Blocking
None found in the code inspected.
Non-blocking
None.
Not verified
The full text of
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded from the review folder; its new test hunks were inspected inreview/diff.patchonly. The implementation and test behavior were not built or executed by me. Author-reported builds, Vulkan tests, hardware results, convention checks, and diff checks were not independently verified. All other changed files listed as included in the manifest were read in targeted ranges or as diff hunks; no other changed file was excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-22T23:34:50Z.
Review: COMMENTED
I tested exact head
5aaf19563738f6d7e0faa816b4609c2c88fcc05fand its direct parent7dad9805051106fa0644413a0b55757a7bc4b711on Windows 11 build 26300 with Intel UHD Graphics (8086:a78b, driver 32.0.101.6127) and Khronos Validation 1.4.369.Both revisions passed 3/3 focused CTests.
agc_driver_depth_export_clampandagc_driver_viewport_indexran on the physical Intel GPU;agc_driver_unused_viewport_depthis CPU-only. The PR's viewport-1 clamp checks ran in full. The separate viewport-index test passed its vertex cases and skipped only its mesh subcase because mesh shader support was unavailable.I also rebuilt the exact head with one emitter selection removed at a time, leaving the fixture unchanged:
viewport 1's exported depth was clamped to viewport 0's ZMAX instead of its own 0.75assertion.After restoring the original source, the clamp test passed again. All seven GPU runs selected the A78B and loaded Khronos Validation. The logs contained no VUIDs, synchronization diagnostics, or device-loss messages. The PR ref stayed unchanged throughout the matrix.
One test-portability note is inline; it did not affect this A78B run because the device supports both required capabilities.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T03:18:07Z.
Review: DISMISSED
Reviewed — comments
Changes are required before merge: retain the existing public
ValidateShaderscall signature when addingmultiViewportsupport.What I ran
Reviewed head
c4811db3959ec72cb96c8fd15b3292728d5bcfbausing the prepared diff and pinned repository reader. No build or tests were run. Read all changed files listed as included inmanifest.json; also read the changedShaderMemory.cpponly at lines 8780–8810. That file is excluded from the review folder because it is too large; its other changed sections were not read.Results
ShaderMemory.cpphunks not readFindings
Blocking
ValidateShadershas a public declaration with a final defaultedmultiViewportparameter, but its definition requires that argument and has no default (core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp:176,core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp:684). Existing callers that rely on the previous function signature and default arguments will fail to compile. Preserve source compatibility by defaulting the new parameter in the definition or by adding an overload for the old signature.Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwere not read.manifest.jsonwere read. No files were excluded byfiles.jsonbecause that document was not provided in the prepared review bundle.To get this to a good state
Make
ValidateShaderssource-compatible for callers that omitmultiViewport, then build and run the affected tests on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T03:33:11Z.
Review: COMMENTED
Reviewed — no blocking findings
The change is coherent on the inspected paths; no blocking defect was verified, but this review session did not run tests and did not read every changed file’s added lines.
What I ran
Reviewed head
b9bfeb58b1f62216b0e7df1a8dca7e1eb51bf048using the prepared diff andrepo_read.pyat the pinned head. No commands or tests were run. The author reports focused tests and convention checks in the PR description; those results were not independently verified.Results
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Not verified
The review is incomplete: several changed files’ added lines were not read.
ShaderMemory.cppwas excluded from the review folder because of its size; its relevant portions were read through the pinned reader. Other changed files, includingShaderValidation.cpp,ShaderRegistry.cpp, the serializer tests, and several shader-recompiler files, were not fully inspected. No local tests or checks were run. The author’s test, hardware, driver, and CI claims were not independently confirmed.To get this to a good state
Complete review of the unread added lines and run the applicable checks before treating this as an approval.
Sources
Behavior claims are based on the prepared diff and pinned-head source excerpts; no external links were used.
Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T04:16:46Z.
Review: CHANGES_REQUESTED
Reviewed exact head b9bfeb58b1f62216b0e7df1a8dca7e1eb51bf048 after its hosted checks completed (11 successful, 5 skipped, no failures). The per-viewport state, serialization/cache-key changes, dual-capability fixture guard, and current 19-argument production call path are consistent.
The compatibility wrapper restores the old 18-argument C++ symbol, but its fixed multiViewport=false forwarding changes one behavior that the old exported path accepted. The baseline PE export table and import library both contain that symbol. A fragment module using BuiltInLayer with ShaderViewportIndexLayerEXT could previously validate when viewportIndexLayer=true; the wrapper now fails at the new blanket fragment check even when the device supports the extension. The actual new fragment ViewportIndex path declares CapabilityMultiViewport, which is already checked separately. Details are inline.
I did not run a new physical-GPU test on this exact head; the earlier A78B depth-clamp run was on 5aaf1956.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T05:09:31Z.
Review: APPROVED
Re-reviewed the exact head
8ee993ba226e7ddd183e18e9b2afa1e26f7e848e. Relative to the reviewedb9bfeb58, 21 of 22 file blobs are unchanged and the only delta is removal of the blanket fragmentmultiViewportrequirement.That resolves the legacy-wrapper compatibility issue: an older caller can still validate
ShaderViewportIndexLayerEXTwhenviewportIndexLayeris available, while a fragment shader that actually declaresCapabilityMultiViewportremains covered by the separate capability check. I rechecked the old wrapper, the capability path, the dual-capability fixture guard, andgit diff --check; no further finding.No new physical-GPU run was performed at this exact head. The earlier GPU evidence applies to the older reviewed implementation; this approval is based on the isolated one-line fix and unchanged remaining blobs.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:13:44Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes show no verified blocking defect, but one large changed test file was only read in targeted ranges and checks were not run independently.
What I ran
Reviewed head
8ee993ba226e7ddd183e18e9b2afa1e26f7e848eusing the prepared diff andrepo_read.py. No commands or tests were run. Read the review description, commit summary, manifest, complete diff, and targeted repository ranges for the viewport depth decoder, shader validation and emission, cache identity, request serialization, and related tests.ShaderMemory.cppwas excluded from the review folder because it was too large; selected ranges were read through the reader.Results
ShaderMemory.cppwas read only in targeted rangesFindings
Blocking
None verified.
Non-blocking
None.
Not verified
The remainder of
ShaderMemory.cppwas not read. The reported build, CTest, Vulkan validation, conventions, and diff checks were not run by this reviewer. No review-folderfiles.jsonwas available through the reader; the manifest and file listing identifiedShaderMemory.cppas the changed file excluded for size.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T09:15:41Z.
Review: COMMENTED
Actionable comments posted: 1
9317c03c-214d-4e82-b554-6512c4d2a5ebReviewing files that changed from the base of the PR and between
0f107f9812and436dd13865.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderInputState.hppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderInputState.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/execution/DepthExportClamp.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/StageIO.hppcore/shader/recompiler/Optimization/include/Optimization/ShaderStageInputInfo.hppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvModuleSetup.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/shader/recompiler/tests/RequestSerializerTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T09:16:32Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and inspected tests support the per-viewport clamp, cache identity, and request compatibility claims.
What I ran
Reviewed head
436dd13865b8aa6d9a1de1505cd4dcdcab224b0fusingrepo_read.pyto inspect the prepared diff, changed-file ranges, and targeted callers. No build or tests were run in this review environment.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas excluded fromfiles/due to size. Its relevant ranges were read throughrepo_read.py, including the added SPIR-V, cache-key, and serialization assertions. The other 21 changed files were included and their changed lines were read; no excluded paths were listed infiles.json.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:59:05Z.
Review: COMMENTED
This branch and #23811 both emit request version 67 with different encodings. I built the exact serializers from both heads. A request with mesh state written by #23811 failed here with the emulated-barycentrics flag error. A request written here failed in #23811 as truncated. Both requests read successfully in their producing branches. Please assign distinct wire versions and keep explicit compatibility coverage. The per-viewport depth-export tests are queued on lavapipe.
AI-assisted: yes.
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.