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

Merged
androidbaklava merged 1 commit from upstream-pr/21713 into main 2026-11-27 18:04:21 +00:00
androidbaklava commented 2026-11-16 16:33:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by androidbaklava on 2026-11-16T16:33:11Z.


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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5340897252 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21713). Originally posted by [androidbaklava](https://github.com/androidbaklava) on 2026-11-16T16:33:11Z. --- ### 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 <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: Intel UHD Graphics (8086:a7a8), Intel driver 101.7084, Windows 11 Home - [x] AI-assisted: yes
MarcZX10 commented 2026-11-21 01:32:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T01:32:12Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6001818011 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21713#pullrequestreview-6001818011). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T01:32:12Z. **Review:** COMMENTED --- # 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.
mihiii1337 commented 2026-11-23 02:57:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T02:57:03Z.

Review: APPROVED


Approved exact head dc718c09e7. I built its clean local merge 2e765f2a71884d07eefaa3db9fde62d108834c4b, whose parents are the current PR base 00f4a33029 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6016075273 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21713#pullrequestreview-6016075273). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-23T02:57:03Z. **Review:** APPROVED --- Approved exact head dc718c09e7e26245e2360e42041ee9c074f85c24. I built its clean local merge 2e765f2a71884d07eefaa3db9fde62d108834c4b, whose parents are the current PR base 00f4a330293f8ee1dcbfc4d16a9f50fd47e2d4b7 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!21713
No description provided.