Skip to content

test(agc): read multisample surfaces in sampled layouts - #3

Open
MarcZX10 wants to merge 12 commits into
Amoenus:codex/feat-msaa-initial-samples-main402from
MarcZX10:codex/6973-msaa-readback-layout
Open

MarcZX10 wants to merge 12 commits into
Amoenus:codex/feat-msaa-initial-samples-main402from
MarcZX10:codex/6973-msaa-readback-layout

Conversation

@MarcZX10

@MarcZX10 MarcZX10 commented Oct 20, 2026 •

Copy link
Copy Markdown

What

This is a stacked follow-up to boykopovar/AnyPS5#6973, based on its head cafd4f749f68244322404b9468b8cd46bd58715c. The readback implementation and test fixture are introduced by that stack, so this change targets its branch and should be integrated only after the parent stack is accepted.

The lower-level agc_driver_multisample_readback_upload fixture dispatches directly through TextureDetiler, outside boykopovar#6973's MultisampleTarget::Sampled() layout transition. It needs to declare the actual sampled layout in its descriptor and transition the test image around the readback. The API now accepts an image layout while preserving GENERAL as the default for existing callers. The fixture uses color or depth read-only layout as appropriate, then restores GENERAL.

This is the outstanding readback-helper case reported in issue #6957. The issue author explicitly authorized carrying the experiment and offered UHD 770/RX 9070 XT retests once a head exists.

Tested

  • python3 tools/check_conventions.py --base upstream/pr/6973 --head HEAD: passed.
  • git diff --check upstream/pr/6973...HEAD: passed.
  • A local broader MSAA integration worktree, with the same layout-aware readback implementation and CheckReadback changes as this PR plus additional unmerged test modes, built agc_driver_multisample_readback_tests. This is integration evidence, not a build of PR test(agc): read multisample surfaces in sampled layouts #3's exact stacked branch.
  • In that worktree, agc_driver_multisample_readback_upload passed 1/1 on Mesa llvmpipe (LLVM 15.0.6) with VK_LAYER_KHRONOS_validation loaded. The run exercised supported 4x cases for 1-, 2-, 4-, 8- and 16-byte elements plus padded 17x5-to-64x32 uploads at XOR 0 and 0x8100. The device did not support the tested 2x/8x cases; those subcases were skipped. The log contains no missing-layer message, VUID, or validation error.
  • The Xeon E5-1620 v2 normally aborts at AnyPS5's CPU-feature guard before test assertions (missing LZCNT, BMI1/2, MOVBE, AVX2 and FMA). For the diagnostic run only, the guard was temporarily bypassed in local HostCpu.cpp, then restored; the target was rebuilt with the original guard afterward. No physical-GPU result is claimed; the offered UHD 770/RX 9070 XT retest remains outstanding.

Checklist

MarcZX100 and others added 12 commits October 16, 2026 22:37
Retain original boykopovar#6971 f65cecd ancestry. Adapt its layout tracking to current shared ownership, device checks, CMASK handling and array/swapped views for focused dependency validation.
Consolidate the previously published initializer and its fault/regression coverage onto the refreshed layout/uploader foundations and the credited boykopovar#6971 dependency composition. Preserve the full snapshot and supported uniform/nonuniform paths, restrict borrowed sampled-view usage and keep current main ownership/device/CMASK handling. Original initializer and test work is preserved at published8068 and its archived history; boykopovar#6971 f65cecd remains an original ancestor. Written with AI assistance.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 882f4483-3f08-4fef-9523-9f6ec90571d0
📥 Commits

Reviewing files that changed from the base of the PR and between cafd4f7 and 4e369ca.

📒 Files selected for processing: 3
  • core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleReadback.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution/MultisampleReadback.cpp

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

📝 Walkthrough

Multisample readback now accepts an image layout for its sampled-image descriptor. The execution test transitions the image to a format-specific read-only layout before dispatch and restores GENERAL afterward.

Changes: Multisample readback layout handling

Layer / File(s) Summary
Layout-aware readback dispatch
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleReadback.cpp, core/libs/prx/libSceAgcDriver/tests/execution/MultisampleReadback.cpp
DispatchMultisampleReadback accepts an optional image layout and uses it for the sampled-image descriptor. The execution test selects depth-stencil read-only or shader-read-only layout by format, applies barriers across all array layers before and after readback, and passes the selected layout to dispatch.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: amoenus

Merge Risk: ⚪ Minimal · up to 4e369

No actionable merge-blocking issue is established. Affected-GPU validation remains useful but is not, by itself, a reason to block the merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: reading multisample surfaces using sampled layouts. It is concise and specific.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description includes the required What, Tested, and Checklist sections. It identifies the parent PR dependency, scope, test commands, runtime limitations, and AI assistance. The checklist is compl…
Full details: Description check

Explanation

The description includes the required What, Tested, and Checklist sections. It identifies the parent PR dependency, scope, test commands, runtime limitations, and AI assistance. The checklist is complete, with additional relevant GPU and follow-up details.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

@MarcZX10

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Amoenus
Amoenus force-pushed the codex/feat-msaa-initial-samples-main402 branch from 419ad89 to 549983f Compare October 21, 2026 14:12
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@Amoenus
Amoenus force-pushed the codex/feat-msaa-initial-samples-main402 branch 2 times, most recently from 77dd406 to 9290696 Compare October 22, 2026 14:33
@cookie42073-cmd

Copy link
Copy Markdown

Hey Marc, I checked the two layout commits on physical Intel and NVIDIA GPUs. They fix the remaining upload/readback failure on my UHD 770.

I applied only 82a4b0a3 and 4e369caf to upstream f6232fcf. The local result is 53138f5b87b9057aa1a89d5582dfc95078fd0558; both original patch IDs and your authorship are preserved. This is a qualification of that three-file change on pinned main f6232fc, not a run of the complete older boykopovar#6973 stack.

Windows 11 Pro 26300, GCC 15.2.0 Release, SPIRV-Tools enabled:

Build Intel UHD 770, 32.0.101.7088 RTX 4070 SUPER, 621.01
Main 8/9 pass; upload fails 9/9 pass
Your layout change 9/9 pass 9/9 pass
Restore the old fixture's paired transition/descriptor behavior, keeping the API change Upload fails again Upload passes
Restore your change, after the full build 9/9 pass 9/9 pass

Intel's failure is the same format=13 first=0 byte=1 expected=0x1f actual=0x00, reproduced twice on main and again in the control. All runs required Vulkan, disabled the application shader cache and loaded Khronos validation; no VUID/SYNC errors or skipped cases. The passing matrix includes all 2/4/8-sample widths, both padded XOR cases, D32 and the array/retile checks. The full configured build and conventions check pass.

The helper still defaults to GENERAL for existing callers. This is synthetic Windows coverage, not a game, full parent-stack, console or Linux/macOS result. AI-assisted qualification and independent review; the implementation remains yours.
AnyPS5-readback-layout-53138f5b-20261102.zip

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants