Skip to content

test(agc): read writable multisample readback fixtures through a sampled-only view - #21713

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
androidbaklava:fix/agc-intel-msaa-sampled-views
Nov 27, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
androidbaklava:fix/agc-intel-msaa-sampled-views

Conversation

@androidbaklava

Copy link
Copy Markdown
Contributor

What

agc_driver_multisample_readback_upload fails on every Intel UHD Graphics run reported in #12522 (readback mismatch: format=13 first=0 byte=1 expected=0x1f actual=0x00). The fixture creates its writable surfaces with STORAGE | SAMPLED | COLOR_ATTACHMENT usage and reads them through an image view that keeps the image's full usage. On Intel's Windows driver, texelFetch through such a view returns sample 0 for every sample index of a multisampled image; the rendered and uploaded data are correct.

Measured on Intel UHD Graphics (8086:a7a8), driver 101.7084, every element size (1, 2, 4, 8, 16 bytes) and sample count (2, 4, 8), with temporary fixture changes that are not part of this PR:

  • render a writable surface, then read it back: wrong in every case;
  • render a non-storage surface, copy it into a writable one, read the writable one: wrong;
  • render a writable surface, copy it into a non-storage one, read that one: correct;
  • read the writable surface through a view whose VkImageViewUsageCreateInfo usage is SAMPLED only: correct in every case.

The driver already creates its sampled views of storage images with VkImageViewUsageCreateInfo (MultisampleTarget.cpp, Texture.cpp), and color sample readback copies into a non-storage snapshot first, so only the fixture is affected. This PR gives writable fixture surfaces a sampled-only arrayView for readback and a separate storage-only storageView for DispatchMultisampleImage, as the driver does. Non-writable surfaces are unchanged.

Part of #12522: this fixes multisample_readback_upload only.

Overlap: #9508 rewrites the same DispatchMultisampleImage call in Upload; whichever lands second only has to keep surface.storageView in that call.

Tested

Windows 11 Home, i7-13620H, Intel UHD Graphics (8086:a7a8), Intel driver 101.7084, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON.

  • ctest -R "^agc_driver_multisample_readback" (9 tests) with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: main 8 of 9 (upload fails); this change 9 of 9, in 3 of 3 rounds.
  • Validation: the same 9 tests with -V on main and on this change with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer and the LunarG SDK 1.4.363 layer. Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation" for all 9 tests, neither contains was not found but was requested by env var VK_INSTANCE_LAYERS, and both have 0 VUID- lines.

Not tested on other GPUs; the change only narrows the usage of the fixture's own views.

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
  • 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: Intel UHD Graphics (8086:a7a8), Intel driver 101.7084, Windows 11 Home
  • AI-assisted: yes

@github-actions github-actions Bot added the agc libSceAgc* label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 7642 core/libs/prx/libSceAgcDriver/tests/execution/MultisampleReadback.cpp
PR 9508 core/libs/prx/libSceAgcDriver/tests/execution/MultisampleReadback.cpp

@domx4q

domx4q commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

NVIDIA Linux run of the focused tests with the Khronos validation layer, main against this PR.

Setup: Arch Linux, kernel 7.3.4, GCC 16.2.1 Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head dc718c09e7 merged with --no-ff onto main e4caa07950 (f7e7565b16, clean merge). The head already merges main up to 5859e9ac25, so the PR column also carries those 33 main commits past e4caa07950. Every test's Selected GPU name= line names the RTX 4090.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_driver_multisample_readback' -V
main e4caa07950 this PR
Result 9/9 passed 9/9 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 9 9
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- 0 0

Unlike the Intel UHD run in the PR, agc_driver_multisample_readback_upload already passes on main here, so the 4090 does not reproduce the failure this PR fixes; it shows the narrower view usage keeps all nine cases passing without validation errors.

No new VUID- errors; all focused tests pass on Ada.

AI-assisted: yes (Claude Code)

@rafaconvaitis

Copy link
Copy Markdown
Contributor

Windows + AMD run; I found no AMD run in the description or in the comments. Head dc718c09e7 merged alone onto main 3c07e1d05e with git merge --no-ff (clean merge).

Setup: Windows 11 25H2 (build 26200), AMD Radeon 760M integrated graphics (1002:15bf, Vulkan device name Radeon 5), AMD Software 26.11.2 (driver 32.0.32029.2010, Vulkan 1.4.359), selected with ANYPS5_GPU=Radeon, WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, Khronos validation layer 1.4.363 (LunarG SDK 1.4.363.1). Only the focused test targets were built; the other execution tests were left out with ANYPS5_AGC_EXECUTION_TESTS.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R '^(<the 9 test names of this comment>)$' -V -j 1, 3 runs per side.

test main this PR
9 tests (names below) passes 3/3 passes 3/3
  • This PR changes tests only, so there is no negative control to run.
  • VUID- lines: 0 in the main and PR logs. Every run logs Selected GPU name=Radeon 5 vendor=0x1002 device=0x15bf and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.
Test names

9 tests: agc_driver_multisample_readback, agc_driver_multisample_readback_depth, agc_driver_multisample_readback_depth_retile, agc_driver_multisample_readback_retile, agc_driver_multisample_readback_uint128, agc_driver_multisample_readback_uint16, agc_driver_multisample_readback_uint64, agc_driver_multisample_readback_uint8, agc_driver_multisample_readback_upload

AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above).

@itsdpraven

Copy link
Copy Markdown

tested this on a second Intel machine + NVIDIA, works here

  • i9-13950HX laptop, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release
  • Intel UHD (8086:a788), driver 101.7088
  • RTX 4090 Laptop GPU, driver 32.0.16.2114
  • head dc718c0 merged onto main fc973e0

agc_driver_multisample_readback_upload on Intel: main fails 3/3 with expected=0x1f actual=0x00, this PR passes 3/3. all 9 multisample_readback tests pass on both GPUs with the PR.

validation layer 1.4.363 loaded, 0 VUID lines on both GPUs.

AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

The review folder and repository reader are unavailable in this session, so the change could not be inspected and no verdict is justified.

What I ran

Not run. The pinned-head reader was not available as a callable tool.

Results

Check Result Note
Review artifacts not run Not accessible
Changed code not run Not inspected

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

Could not read the description, commits, diff, manifest, changed files, or repository context. Files read: none. Files reviewed: none. Excluded files: not verified.

To get this to a good state

Nothing is required.

This was referenced Nov 21, 2026
@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head dc718c09e7, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#18156, #21208, #22013, #22795, #23226, #23385, #24324, #24533, #24582, #24690, #24693, #17553, #19619, #20085, #21081, #19682, #22123, #22529, #22572, #22662, #23479, #23787, #24568, #15330, #21249, #21630, #22040, #23490, #24394). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
agc_driver_multisample_readback, agc_driver_multisample_readback_uint128, agc_driver_multisample_readback_uint16 and 3 more (6 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6540 tests) on the RTX 3080 has 5 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. Traced to other PRs of the batch, each by reverting it and testing again: #17553 (guest_memory); none is in this PR's area. The 2143 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

@goldrake13

Copy link
Copy Markdown
Contributor

UHD 770 desktop run. The Intel runs so far used laptop GPUs (a7a8, a788) with drivers up to 101.7088. On this desktop part with driver 101.7092 the upload mismatch is still there, and this PR fixes it.

Setup: Windows 11 Pro 10.0.26300, i5-14600K, Intel UHD Graphics 770 (8086:a780, desktop Raptor Lake), driver 101.7092, selected with ANYPS5_GPU=UHD. WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Head dc718c09e7 merged with --no-ff onto main c214b0e26f, no conflict. Environment: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, validation layer from Vulkan SDK 1.4.363. Command: ctest -R "^agc_driver_multisample_readback" -V -j 1, 3 rounds, alternating main and this PR.

Test main this PR
agc_driver_multisample_readback_upload fails 3 of 3 (readback mismatch: format=13 first=0 byte=1 expected=0x1f actual=0x00) passes 3 of 3
the other 8 agc_driver_multisample_readback* tests pass 3 of 3 pass 3 of 3

Every log shows Insert instance layer "VK_LAYER_KHRONOS_validation" for all 9 tests. No log has was not found but was requested by env var VK_INSTANCE_LAYERS, and none has a VUID- line.

AI-assisted: yes

@mihiii1337 mihiii1337 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved exact head dc718c0. I built its clean local merge 2e765f2a71884d07eefaa3db9fde62d108834c4b, whose parents are the current PR base 00f4a33 and this head.

Hardware and runtime: physical Intel UHD 8086:a78b, Windows 11 build 26300, Intel driver 32.0.101.6127 through the pinned proprietary ICD, Khronos Validation 1.4.369, Release build, Vulkan required, shader cache disabled, and implicit layers disabled.

I ran the complete nine-test multisample-readback set in three counterbalanced serial rounds (base/change, change/base, base/change):

  • Base: 8/9 in every round. Only agc_driver_multisample_readback_upload failed, each time at format=13, first=0, byte=1, expected=0x1f, actual=0x00.
  • Change: 9/9 in every round. Across those rounds, all 45 regular upload combinations (1/2/4/8/16-byte elements times 2x/4x/8x samples) and all six padded/xor cases completed.
  • The other eight tests passed on both builds in all rounds.

I also performed a narrow causal negative control. In the otherwise unchanged candidate I changed only the read-only array view's usage from SAMPLED_BIT back to the image's combined usage, while leaving the PR's separate storage view and every storage-view call site intact. After rebuilding, the upload test failed 3/3 with the exact same format-13 byte mismatch. I then restored the exact PR source blob, rebuilt, and the full nine-test set passed 9/9 again.

Across the 66 CTest processes in the main matrix, negative control and restored run, all 66 selected the A78B and loaded the requested Khronos layer. There were no skips, partial skips, VUIDs, synchronization hazards, device-loss messages or timeouts. Driver/layer/runtime artifacts stayed stable within every run; the PR ref stayed unchanged; the final source tree is clean and restored to the tested head. The restored executable was rebuilt rather than assumed byte-identical to the earlier link.

No blocking finding remains from this review.

AI-assisted: yes.

@mihiii1337

Copy link
Copy Markdown
Contributor

Precision note for my approval: “no synchronization hazards” means that no SYNC-HAZARD diagnostics appeared in the standard Khronos Validation logs. This matrix did not separately opt into synchronization validation through VK_LAYER_ENABLES or VK_LAYER_VALIDATE_SYNC, so I am not claiming an explicit sync-validation run for #21713.

The A/B result, negative control, ordinary validation result and all other reported checks are unchanged.

AI-assisted: yes.

@BharatYadav007

Copy link
Copy Markdown
Contributor

Independent Windows hardware validation on main 7f99fbd60d plus this PR at dc718c09e7. Each PR was merged and tested separately; no other local patches were included.

Windows 11 Pro 10.0.26300, i7-13620H, WinLibs GCC 15.2.0 UCRT r7, Release. Intel UHD Graphics 8086:a7a8, driver 101.7088; NVIDIA RTX 4050 Laptop GPU 10de:28a1, driver 621.24.

  • Intel UHD: the multisample readback family goes from 8/9 passing on main to 9/9 with this PR. agc_driver_multisample_readback_upload fails 3/3 on main and passes 3/3 with this PR.
  • RTX 4050: all 9/9 corresponding tests pass on both main and this PR.
  • Every test logged its selected GPU and the loader inserting VK_LAYER_KHRONOS_validation 1.4.369. With ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer, there were no missing-layer messages, skips or VUID- errors on either revision.

Focused test validation only; no game or full-suite result is claimed. Exact revisions, commands, verbose logs and JUnit results are in the hardware-validation evidence archive.

Evidence: hardware-validation-evidence.zip

@RavenCurseBurg

Copy link
Copy Markdown
Contributor

I followed up on the synchronization-validation question using an Intel UHD 770 and an RTX 4060. I ran the nine agc_driver_multisample_readback* CTests serially on main at 44eccbf1b0 and on a clean merge of this PR alone (dc718c09e7) onto the same base.

GPU and Windows driver Main Main with this PR
Intel UHD 770 8086:a780, 101.5973 8/9 9/9
NVIDIA RTX 4060 10de:2882, 595.79 9/9 9/9

I explicitly enabled synchronization validation with VK_LAYER_VALIDATE_SYNC=true. To check that the setting took effect, a separate process recorded two overlapping vkCmdFillBuffer writes without a barrier. It emitted exactly one SYNC-HAZARD-WRITE-AFTER-WRITE on each adapter with the setting enabled and none on either with it disabled. The control recorded the commands without submitting them.

On main, the Intel upload test failed at format=13 first=0 byte=1 expected=0x1f actual=0x00. With this PR it reached the passing pixel assertions. All 36 CTest invocations selected the requested adapter and loaded Khronos validation 1.4.369. None skipped or logged a VUID- or SYNC-HAZARD diagnostic.

Windows 11 Pro 24H2 (26100.9711), WinLibs GCC 15.2.0 r7, Release. I used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, and VK_LOADER_DEBUG=layer throughout.

AI-assisted with Codex + GPT-6.2 Astra (xhigh).

@oneandonlydean
oneandonlydean merged commit 9f12ec0 into boykopovar:main Nov 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.