Skip to content

test(agc): retire the 2D MSAA resinfo target before the next fragment count reuses its texels - #1896

Open
Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/28061
Open

Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/28061

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#28061, originally opened by kevinfavv.

Source commit: 029a9ac7e018cfc1edcf48dedea1dd28333d01b0. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


What

Replaces boykopovar#25617, closed by the open PR limit and which GitHub does not let me reopen. Rebased on current main, where the loop now runs two queries per fragment count (native and under DIM 2D, CheckMsaa): both share the same sample count and the same target, so the retirement goes after both, once per fragment count.

agc_driver_image_resinfo_dimension runs its 2D MSAA queries with 2, 4 and 8 fragments on the same Texels block. Sampling the first T# creates a resident multisampled target at that address, and nothing in the test retires it, so the next fragment count finds it and throws on every device that renders more than one of those counts:

AGC graphics: sampling multisampled color target 0x10458a200 (8x8, 2 samples, vk format 100) as a 8x8 texture of 4 samples and guest format 22 (vk 100) is not implemented

The test passes on Linux and Windows only because of where the toolchain places the two globals: the compute shader's store to Output is a shader buffer access, and when Output lies right after Texels it overlaps the target's guarded footprint and retires the target before the next case. On macOS the linker places Output (0x…9000, 512 bytes) right before Texels (0x…9200), so the store never touches the footprint and the target stays. Checked on macOS:

  • running only the 4- and 8-fragment cases: the 4-fragment case passes and the 8-fragment case throws the same error on the leftover 4-sample target;
  • forcing Output right after Texels (both in one struct), with no other change: all three cases pass.

This retires the resident images over Texels after each fragment count with RetireResidentImagesOver_nid_no_patch, as AlphaToCoverage.cpp and MultisampleRetirement.cpp do when a test reuses guest memory, so each case starts from no target whatever the layout. No production code changes. Sampling a resident multisampled target as another sample count stays unimplemented; this test does not need it.

Tested

Apple M5 Pro, macOS 26.5.1, Apple clang 21.0.0, x86_64 Release under Rosetta 2, MoltenVK and loader from Vulkan SDK 1.4.363.1, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1. Tree: main (9f02806) + boykopovar#17425 + boykopovar#11049 + boykopovar#26739 + boykopovar#27739 (needed to build on macOS).

agc_driver_image_resinfo_dimension main this PR
alone, 3 runs failed 3/3 (4-fragment case on the 2-sample target) passed 3/3, 2-, 4- and 8-fragment cases all run, native and under DIM 2D (no skip line)

Not run on Linux or Windows: there the retirement happens at the same point the Output store already caused it, so the cases run as before.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Apple M5 Pro, MoltenVK (Vulkan SDK 1.4.363.1), macOS 26.5.1
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated automated checks for multisample image dimensions and image resource handling. No user-facing behavior changes are included in this update.

… count reuses its texels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: MSAA Resource Cleanup

Layer / File(s) Summary
MSAA iteration cleanup
core/libs/prx/libSceAgcDriver/tests/execution/ImageResinfoDimension.cpp
The test includes MultisampleTarget.hpp and retires resident images associated with Texels after both MSAA checks in each loop iteration.

Suggested reviewers: peacocksir

Change: Other

Merge Risk: Minimal · up to 029a9

This is a test-only cleanup that retires the multisampled target between fragment counts. It has no production impact and is low risk to merge.

Security architecture risk: Minimal · up to 029a9

The AGC test now retires its own resident images before trying the next fragment count. This removes the test’s reliance on incidental buffer placement without changing production driver behavior.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 1
  • Waived: $0.25 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c0bff148-3388-41ba-aa39-0af3b3a75dfd
Commits

Reviewing files that changed from the base of the PR and between 4131f51 and 029a9ac.

Files selected for processing: 1

  • core/libs/prx/libSceAgcDriver/tests/execution/ImageResinfoDimension.cpp

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants