fix(agc): give a multisampled depth-stencil sample shadow attachment usage #15750

Merged
EagleBearerYS merged 2 commits from upstream-pr/15750 into main 2026-11-08 18:08:21 +00:00
EagleBearerYS commented 2026-11-04 12:13:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-11-04T12:13:02Z.


What

On RADV for GFX6-8 GPUs, a multisampled D32S8 surface sampled through its sample shadow returned wrong depths. After vkCmdCopyImage into the shadow, most samples were never written and a few held wrong bytes.

On those GPUs RADV treats a depth-stencil image without depth-stencil attachment usage as not renderable, so its copy into the shadow runs on RADV's compute path. The sample shadow of a format with a stencil aspect now gets depth-stencil attachment usage. RADV then copies on its graphics path, as it already does on GFX9 and later, and the shadow's format query asks for the same usage. There's no driver or device check. Depth-only shadows are unchanged.

This was never a regression. On GFX8 RADV, seven tests have failed since #9533 and #9717 added them. @XatiX pointed out that the bisect's "passing" side ran no tests at all. On today's main, four tests added since then fail there too, so 11 of the 17 agc_driver_native_depth_* tests fail on that GPU. With this PR, all 17 pass.

Sources:

  • RADV in Mesa 26.2.5:

    These lines show which path the copy takes. Why RADV's compute copy leaves samples unwritten on GFX8 isn't traced, so that part is inferred from the runs below. They show the copy fails on the compute path and succeeds on the graphics path.

  • @ryanc2112's runs on an RX 570 (RADV POLARIS10, Mesa 26.2.5), with diagnostic branches that printed every fetch (first run, switches):

Mode Seven tests Mismatched 2-sample D32S8 fetches
as on main 0 / 7 2-10 of 30, reading 05050505
shadow cleared to 0.5 first 0 / 7 20-27 of 30, mostly still 0.5, so never written
shadow with depth-stencil attachment usage (this PR) 7 / 7 0
attachment sampled directly 7 / 7 0

The same Mesa on a Steam Deck (RADV VANGOGH) passed every mode. RADV_DEBUG=nohiz and nofastclears changed nothing, and no VUID- errors were reported in any mode.

Why the attachment usage and not direct sampling: both pass. The usage keeps the shadow, so the sampling path is unchanged on every driver, and only the shadow's usage flags change.

One trade-off, from @Superseabas's review: the shadow's format query now includes the attachment usage. A driver that supports a sampled multisample D32S8 shadow at some sample count only without that usage would skip the shadow at that count. It would then sample the attachment directly if that's supported, or have no sampled path. Vulkan reports sample counts per usage, so this can differ in principle. Superseabas's probe shows the same counts with and without the usage on both of their GPUs.

Overlap: #15301 (@Prophet069) changes how createSampleShadow allocates the shadow's memory, and this PR changes its usage flags. The two merge cleanly in either order and compose. None of the other open PRs that touch DepthSurface.cpp changes the shadow's usage. No other D+S image in the AGC driver is created multisampled without depth-stencil attachment usage.

Tested

The second commit adds a 64x32 D32S8 case to agc_driver_native_depth_driver_path at each supported sample count. The 5x3 surfaces the tests used before get no HTILE. At 64x32, drivers can compress the attachment and, with this PR's usage, the shadow.

On today's main, RX 570 (RADV POLARIS10, Mesa 26.2.5), from @ryanc2112 (results), 3 of 3 runs each.

Tree agc_driver_native_depth_*
main b11c7bf84f 11 of 17 fail
b11c7bf84f with 0605086887 and 5537967776 cherry-picked, the same tree as this PR's head 17 / 17 pass, no VUID- errors

The 11 are the original seven plus four tests added since 9090972b7e:

  • aliased_depth_depth_only and aliased_depth_stencil, from #9742;
  • uniform_planes, from #14005;
  • publication, from #13021.

So the change also covers those tests on that GPU. Setup: a clean build, GCC 16.2.1, Release, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, VK_LAYER_KHRONOS_validation, ctest --no-tests=error.

The first confirmation, on both machines. Earlier, @ryanc2112 ran the seven failing tests on both machines, 3 times at each commit, with ctest --no-tests=error and no diagnostic switches (results).

  • Both commits were on 9090972b7e: 0605086887 is the new case without the fix, and 5537967776 adds the fix.
  • This branch carries the same lines on current main, with the fix first so the new case never lands failing.
  • A verbose driver_path run at each commit loaded VK_LAYER_KHRONOS_validation and reported no VUID- errors.
  • Build: GCC 16.2.1, Release, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1.
Device Before: 0605086887 (the new case, no fix), or main where marked With the fix: 5537967776, or this branch where marked
RX 570, RADV POLARIS10, Mesa 26.2.5 (@ryanc2112) 0 / 7, 3 of 3 runs: driver_path stops at a sampled depth on the driver's device is not 0.000000 7 / 7, 3 of 3 runs, 0 VUIDs
Steam Deck, RADV VANGOGH, Mesa 26.2.5 (@ryanc2112) not run 7 / 7, 3 of 3 runs, 0 VUIDs
RTX 3070 Laptop, NVIDIA's Windows driver main: 11 / 12*, 0 VUIDs 11 / 12*, 0 VUIDs
Radeon Renoir iGPU, AMD's Windows driver main: 11 / 12*, 0 VUIDs 11 / 12*, 0 VUIDs
lavapipe (Mesa 25.2.8), GitHub's Linux runner, on b11c7bf84f (run) main's code with the new case: 17 / 18 pass, 1 skips 17 / 18 pass, 1 skips, ×10
lavapipe, GitHub's Linux runner, with validation (run) main's tree: 17 / 18 pass, 1 skips 17 / 18 pass, 1 skips, 3 runs; no VUIDs added
GitHub's Windows runner (same run) all 18 skip, no Vulkan device all 18 skip, no Vulkan device, ×10

* Of the 12 agc_driver_native_depth_* tests:

  • bda_clear wasn't built in that tree;
  • driver_queued_fill skips on Windows, as it does on main.

The local runs compared main with the two commits, both on 8b7d6c183b, where neither file differs from 9090972b7e. Both sides used the same machine and GPU, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and ctest -V.

  • Neither log reports was not found but was requested by env var VK_INSTANCE_LAYERS. A VK_LOADER_DEBUG=layer run showed the layer inserted.
  • The driver-path test checked 6 cases on main and 9 with the 64x32 cases. The 64x32 cases passed at 2, 4 and 8 samples.
  • Clocks weren't held; this is a correctness check.

On GitHub's runners:

  • The one skip on Linux is agc_driver_native_depth_bda_clear, which skips itself there.
  • In the validation run, VK_LAYER_KHRONOS_validation loaded on both sides. The only VUID, VUID-VkDeviceCreateInfo-pNext-pNext, is in main's log too.
  • The libc and libkernel suites ran with the fix, 0 failed: 303 and 327 tests on Linux, 334 and 345 on Windows.

@Superseabas's review at this head (approval): 7fe8857559 merged onto main b11c7bf84f, run on two Windows GPUs without the GFX8 copy problem, so a no-regression check, not a red check of the fix. Windows 11, WinLibs GCC 16.2.0, Release, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -R '^agc_driver_native_depth.*$'.

GPU Driver main merged
NVIDIA GeForce RTX 5070 Ti 621.01 16 pass, 1 skip 16 pass, 1 skip
AMD Radeon Graphics, Ryzen 7 7700X iGPU (RDNA 2) AMD 26.10.2 16 pass, 1 skip 16 pass, 1 skip
  • The skip is driver_queued_fill on both sides. No VUID- lines in any of the four runs.
  • driver_path on the merge, 3 runs per GPU: cases checked=9 unavailable=0 every time, the 64x32 cases at 2, 4 and 8 samples included.
  • A format probe with the usages from DepthSurface.cpp reports sample counts 0xf for D32S8 and D32 on both GPUs, with main's shadow usage, with this PR's, and for the attachment's. So the runs take the shadow path, with the new usage.

TechLevelZero's NVIDIA GPU test at this head (report): 7fe8857559 merged onto main b11c7bf, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, 2,822 of 3,894 tests selected. 2,768 passed, 5 failed (none new: 3 also fail on main, 2 unstable on main), 49 skipped, and no new validation IDs over 974 GPU tests. Of the agc_driver_native_* tests, only agc_driver_native_multisample_depth and agc_driver_native_depth_bda_clear were selected, and both passed. agc_driver_native_depth_driver_path, which holds the new case, wasn't selected.

Checks:

  • tools/check_conventions.py: all passed.
  • No comments added.

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: n/a, none
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none. Related: #9717, #9533
  • Unblocks: none
  • GPUs tested: RX 570 (RADV), Steam Deck (RADV), RTX 3070 Laptop (NVIDIA), Radeon Renoir (AMD Windows), lavapipe; RTX 5070 Ti (NVIDIA Windows) and Ryzen 7 7700X iGPU (AMD Windows), by @Superseabas; RTX 2000 Ada (TechLevelZero's NVIDIA GPU test)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5154011658 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15750). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-11-04T12:13:02Z. --- ### What On RADV for GFX6-8 GPUs, a multisampled D32S8 surface sampled through its sample shadow returned wrong depths. After `vkCmdCopyImage` into the shadow, most samples were never written and a few held wrong bytes. On those GPUs RADV treats a depth-stencil image without depth-stencil attachment usage as not renderable, so its copy into the shadow runs on RADV's compute path. The sample shadow of a format with a stencil aspect now gets depth-stencil attachment usage. RADV then copies on its graphics path, as it already does on GFX9 and later, and the shadow's format query asks for the same usage. There's no driver or device check. Depth-only shadows are unchanged. **This was never a regression.** On GFX8 RADV, seven tests have failed since #9533 and #9717 added them. @XatiX pointed out that the bisect's "passing" side ran no tests at all. On today's `main`, four tests added since then fail there too, so 11 of the 17 `agc_driver_native_depth_*` tests fail on that GPU. With this PR, all 17 pass. **Sources:** - RADV in Mesa 26.2.5: - [`radv_image.c` L652-L674](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.5/src/amd/vulkan/radv_image.c#L652-L674): on `gfx_level <= GFX8`, a depth+stencil image without depth-stencil attachment usage gets `RADEON_SURF_NO_RENDER_TARGET`; - [`radv_image.c` L1756-L1765](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.5/src/amd/vulkan/radv_image.c#L1756-L1765): such an image isn't renderable; - [`radv_meta_copy.c` L832](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.5/src/amd/vulkan/meta/radv_meta_copy.c#L832): a copy into a non-renderable image uses compute; - [`radv_meta_bufimage.c` L666-L762](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.5/src/amd/vulkan/meta/radv_meta_bufimage.c#L666-L762) and [`radv_meta_nir.c` L602-L651](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.5/src/amd/vulkan/nir/radv_meta_nir.c#L602-L651): that path fetches and stores each sample. These lines show which path the copy takes. Why RADV's compute copy leaves samples unwritten on GFX8 isn't traced, so that part is inferred from the runs below. They show the copy fails on the compute path and succeeds on the graphics path. - @ryanc2112's runs on an RX 570 (RADV POLARIS10, Mesa 26.2.5), with diagnostic branches that printed every fetch ([first run](https://github.com/boykopovar/AnyPS5/pull/9717#issuecomment-6589827853), [switches](https://github.com/boykopovar/AnyPS5/pull/9717#issuecomment-6591207227)): | Mode | Seven tests | Mismatched 2-sample D32S8 fetches | |---|---|---| | as on `main` | 0 / 7 | 2-10 of 30, reading `05050505` | | shadow cleared to 0.5 first | 0 / 7 | 20-27 of 30, mostly still 0.5, so never written | | shadow with depth-stencil attachment usage (this PR) | **7 / 7** | 0 | | attachment sampled directly | **7 / 7** | 0 | The same Mesa on a Steam Deck (RADV VANGOGH) passed every mode. `RADV_DEBUG=nohiz` and `nofastclears` changed nothing, and no `VUID-` errors were reported in any mode. **Why the attachment usage and not direct sampling:** both pass. The usage keeps the shadow, so the sampling path is unchanged on every driver, and only the shadow's usage flags change. **One trade-off,** from @Superseabas's [review](https://github.com/boykopovar/AnyPS5/pull/15750#pullrequestreview-5771974568): the shadow's format query now includes the attachment usage. A driver that supports a sampled multisample D32S8 shadow at some sample count only without that usage would skip the shadow at that count. It would then sample the attachment directly if that's supported, or have no sampled path. Vulkan reports sample counts per usage, so this can differ in principle. Superseabas's probe shows the same counts with and without the usage on both of their GPUs. **Overlap:** #15301 (@Prophet069) changes how `createSampleShadow` allocates the shadow's memory, and this PR changes its usage flags. The two merge cleanly in either order and compose. None of the other open PRs that touch `DepthSurface.cpp` changes the shadow's usage. No other D+S image in the AGC driver is created multisampled without depth-stencil attachment usage. ### Tested The second commit adds a 64x32 D32S8 case to `agc_driver_native_depth_driver_path` at each supported sample count. The 5x3 surfaces the tests used before get no HTILE. At 64x32, drivers can compress the attachment and, with this PR's usage, the shadow. **On today's `main`, RX 570 (RADV POLARIS10, Mesa 26.2.5),** from @ryanc2112 ([results](https://github.com/boykopovar/AnyPS5/pull/9717#issuecomment-6629459393)), 3 of 3 runs each. | Tree | `agc_driver_native_depth_*` | |---|---| | `main` `b11c7bf84f` | 11 of 17 fail | | `b11c7bf84f` with `0605086887` and `5537967776` cherry-picked, the same tree as this PR's head | **17 / 17 pass**, no `VUID-` errors | The 11 are the original seven plus four tests added since `9090972b7e`: - `aliased_depth_depth_only` and `aliased_depth_stencil`, from #9742; - `uniform_planes`, from #14005; - `publication`, from #13021. So the change also covers those tests on that GPU. Setup: a clean build, GCC 16.2.1, Release, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `VK_LAYER_KHRONOS_validation`, `ctest --no-tests=error`. **The first confirmation, on both machines.** Earlier, @ryanc2112 ran the seven failing tests on both machines, 3 times at each commit, with `ctest --no-tests=error` and no diagnostic switches ([results](https://github.com/boykopovar/AnyPS5/pull/9717#issuecomment-6628464558)). - Both commits were on `9090972b7e`: `0605086887` is the new case without the fix, and `5537967776` adds the fix. - This branch carries the same lines on current `main`, with the fix first so the new case never lands failing. - A verbose `driver_path` run at each commit loaded `VK_LAYER_KHRONOS_validation` and reported no `VUID-` errors. - Build: GCC 16.2.1, Release, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`. | Device | Before: `0605086887` (the new case, no fix), or `main` where marked | With the fix: `5537967776`, or this branch where marked | |---|---|---| | RX 570, RADV POLARIS10, Mesa 26.2.5 (@ryanc2112) | 0 / 7, 3 of 3 runs: `driver_path` stops at `a sampled depth on the driver's device is not 0.000000` | **7 / 7**, 3 of 3 runs, 0 VUIDs | | Steam Deck, RADV VANGOGH, Mesa 26.2.5 (@ryanc2112) | not run | **7 / 7**, 3 of 3 runs, 0 VUIDs | | RTX 3070 Laptop, NVIDIA's Windows driver | `main`: 11 / 12*, 0 VUIDs | 11 / 12*, 0 VUIDs | | Radeon Renoir iGPU, AMD's Windows driver | `main`: 11 / 12*, 0 VUIDs | 11 / 12*, 0 VUIDs | | lavapipe (Mesa 25.2.8), GitHub's Linux runner, on `b11c7bf84f` ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41815877214)) | `main`'s code with the new case: 17 / 18 pass, 1 skips | 17 / 18 pass, 1 skips, ×10 | | lavapipe, GitHub's Linux runner, with validation ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41815976706)) | `main`'s tree: 17 / 18 pass, 1 skips | 17 / 18 pass, 1 skips, 3 runs; no VUIDs added | | GitHub's Windows runner ([same run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41815877214)) | all 18 skip, no Vulkan device | all 18 skip, no Vulkan device, ×10 | \* Of the 12 `agc_driver_native_depth_*` tests: - `bda_clear` wasn't built in that tree; - `driver_queued_fill` skips on Windows, as it does on `main`. The local runs compared `main` with the two commits, both on 8b7d6c183b, where neither file differs from 9090972b7e. Both sides used the same machine and GPU, with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `ctest -V`. - Neither log reports `was not found but was requested by env var VK_INSTANCE_LAYERS`. A `VK_LOADER_DEBUG=layer` run showed the layer inserted. - The driver-path test checked 6 cases on `main` and 9 with the 64x32 cases. The 64x32 cases passed at 2, 4 and 8 samples. - Clocks weren't held; this is a correctness check. On GitHub's runners: - The one skip on Linux is `agc_driver_native_depth_bda_clear`, which skips itself there. - In the validation run, `VK_LAYER_KHRONOS_validation` loaded on both sides. The only VUID, `VUID-VkDeviceCreateInfo-pNext-pNext`, is in `main`'s log too. - The libc and libkernel suites ran with the fix, 0 failed: 303 and 327 tests on Linux, 334 and 345 on Windows. **@Superseabas's review at this head** ([approval](https://github.com/boykopovar/AnyPS5/pull/15750#pullrequestreview-5771974568)): `7fe8857559` merged onto `main` `b11c7bf84f`, run on two Windows GPUs without the GFX8 copy problem, so a no-regression check, not a red check of the fix. Windows 11, WinLibs GCC 16.2.0, Release, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ctest -R '^agc_driver_native_depth.*$'`. | GPU | Driver | `main` | merged | |---|---|---|---| | NVIDIA GeForce RTX 5070 Ti | 621.01 | 16 pass, 1 skip | 16 pass, 1 skip | | AMD Radeon Graphics, Ryzen 7 7700X iGPU (RDNA 2) | AMD 26.10.2 | 16 pass, 1 skip | 16 pass, 1 skip | - The skip is `driver_queued_fill` on both sides. No `VUID-` lines in any of the four runs. - `driver_path` on the merge, 3 runs per GPU: `cases checked=9 unavailable=0` every time, the 64x32 cases at 2, 4 and 8 samples included. - A format probe with the usages from `DepthSurface.cpp` reports sample counts `0xf` for D32S8 and D32 on both GPUs, with `main`'s shadow usage, with this PR's, and for the attachment's. So the runs take the shadow path, with the new usage. **TechLevelZero's NVIDIA GPU test at this head** ([report](https://github.com/boykopovar/AnyPS5/pull/15750#issuecomment-6632252308)): `7fe8857559` merged onto `main` `b11c7bf`, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, 2,822 of 3,894 tests selected. 2,768 passed, 5 failed (none new: 3 also fail on `main`, 2 unstable on `main`), 49 skipped, and no new validation IDs over 974 GPU tests. Of the `agc_driver_native_*` tests, only `agc_driver_native_multisample_depth` and `agc_driver_native_depth_bda_clear` were selected, and both passed. `agc_driver_native_depth_driver_path`, which holds the new case, wasn't selected. **Checks:** - `tools/check_conventions.py`: all passed. - No comments added. ### 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: n/a, none - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none. Related: #9717, #9533 - [x] Unblocks: none - [x] GPUs tested: RX 570 (RADV), Steam Deck (RADV), RTX 3070 Laptop (NVIDIA), Radeon Renoir (AMD Windows), lavapipe; RTX 5070 Ti (NVIDIA Windows) and Ryzen 7 7700X iGPU (AMD Windows), by @Superseabas; RTX 2000 Ada (TechLevelZero's NVIDIA GPU test) - [x] AI-assisted: yes
Superseabas commented 2026-11-04 16:32:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-04T16:32:14Z.

Review: APPROVED


Head 7fe8857559 merged onto current main b11c7bf84f (clean merge, local only): code read and a run on two Windows GPUs. The usage change applies to every driver, and this checks it at the current head on NVIDIA Blackwell and on AMD's Windows driver for an RDNA 2 iGPU. Neither GPU has the GFX8 compute-copy problem, so this is a no-regression check, not a red check of the fix itself.

Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release, BUILD_TESTING=ON. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -R '^agc_driver_native_depth.*$', ANYPS5_GPU selecting the device (confirmed by Selected GPU):

GPU Driver main merged
NVIDIA GeForce RTX 5070 Ti (10de:2c05) 621.01 16 pass, 1 skip 16 pass, 1 skip
AMD Radeon Graphics, Ryzen 7 7700X iGPU (1002:164e) AMD 26.10.2 16 pass, 1 skip 16 pass, 1 skip
  • The skip is agc_driver_native_depth_driver_queued_fill on both sides, as in the description. There are no VUID- lines and no missing-layer line in any of the four runs.

  • agc_driver_native_depth_driver_path on the merge, 3 runs per GPU: cases checked=9 unavailable=0 every time, including the three new 64x32 cases at 2, 4 and 8 samples.

  • The sample shadow path is the one exercised here. A standalone vkGetPhysicalDeviceImageFormatProperties probe with the exact usages from DepthSurface.cpp (2D, optimal tiling, flags 0) reports sampleCounts 0xf for D32S8 and D32 on both GPUs:

    • for main's shadow usage, SAMPLED | TRANSFER_DST;
    • for this PR's, which adds DEPTH_STENCIL_ATTACHMENT;
    • for the direct attachment usage.

    So useSampleShadow stays true on these drivers and the shadow now gets the attachment usage.

  • check_conventions.py --base main passes on the merge.

Read through the change: sampleShadowUsage() adds DEPTH_STENCIL_ATTACHMENT only when HasStencil(hostFormat), so depth-only shadows keep main's usage. The same function feeds the format query that decides useSampleShadow and the vkCreateImage in createSampleShadow, so the query and the image agree. One consequence: a driver that supports sampled multisample D32S8 but not with depth-stencil attachment usage at some sample count would leave the shadow and take the direct attachment path if it is sampleable, or have no sampled path. Neither GPU here hits that. The test change only makes the extent a parameter and adds a 64x32 case per sample count on the whole-fill path, with unavailable counting the extra case. I found nothing to change.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5771974568 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15750#pullrequestreview-5771974568). Originally posted by [Superseabas](https://github.com/Superseabas) on 2026-11-04T16:32:14Z. **Review:** APPROVED --- Head `7fe8857559` merged onto current `main` `b11c7bf84f` (clean merge, local only): code read and a run on two Windows GPUs. The usage change applies to every driver, and this checks it at the current head on NVIDIA Blackwell and on AMD's Windows driver for an RDNA 2 iGPU. Neither GPU has the GFX8 compute-copy problem, so this is a no-regression check, not a red check of the fix itself. Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (`x86_64-ucrt-posix-seh`, r3), Release, `BUILD_TESTING=ON`. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ctest -R '^agc_driver_native_depth.*$'`, `ANYPS5_GPU` selecting the device (confirmed by `Selected GPU`): | GPU | Driver | `main` | merged | |---|---|---|---| | NVIDIA GeForce RTX 5070 Ti (`10de:2c05`) | 621.01 | 16 pass, 1 skip | 16 pass, 1 skip | | AMD Radeon Graphics, Ryzen 7 7700X iGPU (`1002:164e`) | AMD 26.10.2 | 16 pass, 1 skip | 16 pass, 1 skip | - The skip is `agc_driver_native_depth_driver_queued_fill` on both sides, as in the description. There are no `VUID-` lines and no missing-layer line in any of the four runs. - `agc_driver_native_depth_driver_path` on the merge, 3 runs per GPU: `cases checked=9 unavailable=0` every time, including the three new 64x32 cases at 2, 4 and 8 samples. - The sample shadow path is the one exercised here. A standalone `vkGetPhysicalDeviceImageFormatProperties` probe with the exact usages from `DepthSurface.cpp` (`2D`, optimal tiling, flags 0) reports `sampleCounts` `0xf` for D32S8 and D32 on both GPUs: - for `main`'s shadow usage, `SAMPLED | TRANSFER_DST`; - for this PR's, which adds `DEPTH_STENCIL_ATTACHMENT`; - for the direct attachment usage. So `useSampleShadow` stays true on these drivers and the shadow now gets the attachment usage. - `check_conventions.py --base main` passes on the merge. Read through the change: `sampleShadowUsage()` adds `DEPTH_STENCIL_ATTACHMENT` only when `HasStencil(hostFormat)`, so depth-only shadows keep `main`'s usage. The same function feeds the format query that decides `useSampleShadow` and the `vkCreateImage` in `createSampleShadow`, so the query and the image agree. One consequence: a driver that supports sampled multisample D32S8 but not with depth-stencil attachment usage at some sample count would leave the shadow and take the direct attachment path if it is sampleable, or have no sampled path. Neither GPU here hits that. The test change only makes the extent a parameter and adds a 64x32 case per sample count on the whole-fill path, with `unavailable` counting the extra case. I found nothing to change. AI-assisted: yes (Claude Code)
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!15750
No description provided.