AGC (Intel iGPU, Windows): stencil sampled through the native D32S8 sample shadow is lost; three native_depth tests fail #16883

Open
opened 2026-11-07 19:54:34 +00:00 by gabichuuuuu · 0 comments
gabichuuuuu commented 2026-11-07 19:54:34 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T19:54:34Z.


What happens

Three native multisample depth tests fail every run on an Intel integrated GPU and pass on the NVIDIA laptop GPU in the same machine and build:

test error on the Intel iGPU
agc_driver_native_depth_stencil_view AGC graphics: a native D32S8 sample read through the depth and stencil views in one dispatch lost its depth, its stencil or the stencil view's component mapping
agc_driver_native_depth_uniform_planes AGC graphics: a uniform stencil plane without HTILE was not imported into every sample: sample 257 holds 0, the plane 195 (first case, 2 samples)
agc_driver_native_depth_publication AGC graphics: native D32S8 publication lost live samples, HTILE, padding or guest writes

The new agc_driver_native_depth_publication_without_htile from #15688 fails the same way there (a written D32S8 owner without HTILE did not publish its stencil samples and padding). The tests that only check stencil through stencil tests on the attachment (native_depth_stencil, separate_stencil, aliased_stencil) pass; the failing ones all sample the stencil aspect from a shader.

Title, test or build step

The three ctests above. No title.

AnyPS5 commit

main 6b733c4ef2, nothing merged on top. Also seen on 4e44ed59b2, and with #16363, #16364, #16365 and #16301 merged (no change).

System

Windows 11 x64, Intel integrated GPU (one queue, subgroup 32, Vulkan 1.4.323, Intel driver 101.70xx) and an NVIDIA laptop GPU (driver 610) in the same laptop. WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON.

Host report

Not included: no title run, and the test logs above already show the device choice and queue setup.

Steps to reproduce

ANYPS5_GPU=Intel ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_native_depth_(stencil_view|uniform_planes|publication)$' -V

Each test stops within a few seconds; 3 of 3 runs fail. With ANYPS5_GPU=NVIDIA they pass.

Log

Intel iGPU, 4e44ed59b2 (same messages on 6b733c4ef2):

[write-watch] Windows direct host imports use comparisons (no second queue to settle imports on); separate shared aliases retain guest write tracking
AGC graphics: a native D32S8 sample read through the depth and stencil views in one dispatch lost its depth, its stencil or the stencil view's component mapping
22/28 Test #2105: agc_driver_native_depth_stencil_view ...............***Failed    0.59 sec
AGC graphics: a uniform stencil plane without HTILE was not imported into every sample: sample 257 holds 0, the plane 195
24/28 Test #2107: agc_driver_native_depth_uniform_planes .............***Failed    0.58 sec
AGC graphics: native D32S8 publication lost live samples, HTILE, padding or guest writes
26/28 Test #2109: agc_driver_native_depth_publication ................***Failed    0.38 sec

What was checked

  • 3 of 3 runs on each of 4e44ed59b2 and 6b733c4ef2; same messages every time.
  • No VUID- lines, but the validation layer isn't installed on this machine, so that says nothing.
  • #12522 lists other Intel iGPU failures on Windows (host import, MSAA DCC, readback); these three aren't among them.
  • Not checked on another Intel GPU or driver, or on Linux (ANV).

Cause, narrowed down. All three go through the sample shadow in Graphics/src/DepthSurface.cpp. When useSampleShadow is chosen (:590), the D32S8 attachment is copied with vkCmdCopyImage into a sampled-only image (refreshSampleShadow, :1646, stencil included once a stencil read happens) and the stencil view is made on that copy. Both GPUs here report both paths as supported (shadowOk=1 directOk=1) and pick the shadow.

I ran main 6b733c4ef2 with two local experiments (not proposed as-is):

main 6b733c4ef2 Intel iGPU, 3 failing tests Intel, controls* NVIDIA, 3 tests
as is (sample shadow) 3 fail 5 pass 3 pass
APS5_NO_IMAGE_SLABS=1 3 fail, same messages
shadow disabled, attachment sampled directly 3 pass (2, 4 and 8 samples) 5 pass 3 pass
shadow kept, depth and stencil copied as two VkImageCopy regions instead of one 3 fail, same messages 5 pass 3 pass

* ^agc_driver_native_depth_(stencil|separate_stencil|aliased_stencil|clears|expand_gate)$, which sample depth through the same shadow.

So on this Intel driver, depth survives the shadow path and stencil doesn't, whether it is copied together with depth or on its own, while sampling the attachment's stencil directly works. I haven't separated whether the copy or the later stencil sample of the shadow image loses it. I found nothing invalid in the copy itself (same sample count and aspects, GENERAL on both sides, barriers around it), so this may be a driver bug, but I can't run the validation layer on this machine to confirm. Whatever the fix, it should follow from device capabilities, not the vendor; preferring the direct path when it is supported passes on both GPUs here, but I don't know why the shadow is preferred today.

The experiment patch, for reproduction (EXP_NO_SAMPLE_SHADOW=1 selects the direct path and the line prints the choice):

-                useSampleShadow = supports(shadowResult, shadowProperties);
+                useSampleShadow = std::getenv("EXP_NO_SAMPLE_SHADOW") == nullptr && supports(shadowResult, shadowProperties);
                 const bool directSampleable = supports(directResult, directProperties);
+                std::fprintf(stderr, "EXP depth samples=%u shadowOk=%d directOk=%d useShadow=%d\n", target.samples, supports(shadowResult, shadowProperties) ? 1 : 0, directSampleable ? 1 : 0, useSampleShadow ? 1 : 0);

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6263514193 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/16883). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-07T19:54:34Z. --- ### What happens Three native multisample depth tests fail every run on an Intel integrated GPU and pass on the NVIDIA laptop GPU in the same machine and build: | test | error on the Intel iGPU | |---|---| | `agc_driver_native_depth_stencil_view` | `AGC graphics: a native D32S8 sample read through the depth and stencil views in one dispatch lost its depth, its stencil or the stencil view's component mapping` | | `agc_driver_native_depth_uniform_planes` | `AGC graphics: a uniform stencil plane without HTILE was not imported into every sample: sample 257 holds 0, the plane 195` (first case, 2 samples) | | `agc_driver_native_depth_publication` | `AGC graphics: native D32S8 publication lost live samples, HTILE, padding or guest writes` | The new `agc_driver_native_depth_publication_without_htile` from #15688 fails the same way there (`a written D32S8 owner without HTILE did not publish its stencil samples and padding`). The tests that only check stencil through stencil tests on the attachment (`native_depth_stencil`, `separate_stencil`, `aliased_stencil`) pass; the failing ones all sample the stencil aspect from a shader. ### Title, test or build step The three ctests above. No title. ### AnyPS5 commit `main` `6b733c4ef2`, nothing merged on top. Also seen on `4e44ed59b2`, and with #16363, #16364, #16365 and #16301 merged (no change). ### System Windows 11 x64, Intel integrated GPU (one queue, subgroup 32, Vulkan 1.4.323, Intel driver 101.70xx) and an NVIDIA laptop GPU (driver 610) in the same laptop. WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. ### Host report Not included: no title run, and the test logs above already show the device choice and queue setup. ### Steps to reproduce ``` ANYPS5_GPU=Intel ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_native_depth_(stencil_view|uniform_planes|publication)$' -V ``` Each test stops within a few seconds; 3 of 3 runs fail. With `ANYPS5_GPU=NVIDIA` they pass. ### Log Intel iGPU, `4e44ed59b2` (same messages on `6b733c4ef2`): ``` [write-watch] Windows direct host imports use comparisons (no second queue to settle imports on); separate shared aliases retain guest write tracking AGC graphics: a native D32S8 sample read through the depth and stencil views in one dispatch lost its depth, its stencil or the stencil view's component mapping 22/28 Test #2105: agc_driver_native_depth_stencil_view ...............***Failed 0.59 sec AGC graphics: a uniform stencil plane without HTILE was not imported into every sample: sample 257 holds 0, the plane 195 24/28 Test #2107: agc_driver_native_depth_uniform_planes .............***Failed 0.58 sec AGC graphics: native D32S8 publication lost live samples, HTILE, padding or guest writes 26/28 Test #2109: agc_driver_native_depth_publication ................***Failed 0.38 sec ``` ### What was checked - 3 of 3 runs on each of `4e44ed59b2` and `6b733c4ef2`; same messages every time. - No `VUID-` lines, but the validation layer isn't installed on this machine, so that says nothing. - #12522 lists other Intel iGPU failures on Windows (host import, MSAA DCC, readback); these three aren't among them. - Not checked on another Intel GPU or driver, or on Linux (ANV). **Cause, narrowed down.** All three go through the sample shadow in `Graphics/src/DepthSurface.cpp`. When `useSampleShadow` is chosen (`:590`), the D32S8 attachment is copied with `vkCmdCopyImage` into a sampled-only image (`refreshSampleShadow`, `:1646`, stencil included once a stencil read happens) and the stencil view is made on that copy. Both GPUs here report both paths as supported (`shadowOk=1 directOk=1`) and pick the shadow. I ran `main` `6b733c4ef2` with two local experiments (not proposed as-is): | `main` `6b733c4ef2` | Intel iGPU, 3 failing tests | Intel, controls* | NVIDIA, 3 tests | |---|---|---|---| | as is (sample shadow) | 3 fail | 5 pass | 3 pass | | `APS5_NO_IMAGE_SLABS=1` | 3 fail, same messages | | | | shadow disabled, attachment sampled directly | **3 pass** (2, 4 and 8 samples) | 5 pass | 3 pass | | shadow kept, depth and stencil copied as two `VkImageCopy` regions instead of one | 3 fail, same messages | 5 pass | 3 pass | \* `^agc_driver_native_depth_(stencil|separate_stencil|aliased_stencil|clears|expand_gate)$`, which sample depth through the same shadow. So on this Intel driver, depth survives the shadow path and stencil doesn't, whether it is copied together with depth or on its own, while sampling the attachment's stencil directly works. I haven't separated whether the copy or the later stencil sample of the shadow image loses it. I found nothing invalid in the copy itself (same sample count and aspects, `GENERAL` on both sides, barriers around it), so this may be a driver bug, but I can't run the validation layer on this machine to confirm. Whatever the fix, it should follow from device capabilities, not the vendor; preferring the direct path when it is supported passes on both GPUs here, but I don't know why the shadow is preferred today. The experiment patch, for reproduction (`EXP_NO_SAMPLE_SHADOW=1` selects the direct path and the line prints the choice): ```diff - useSampleShadow = supports(shadowResult, shadowProperties); + useSampleShadow = std::getenv("EXP_NO_SAMPLE_SHADOW") == nullptr && supports(shadowResult, shadowProperties); const bool directSampleable = supports(directResult, directProperties); + std::fprintf(stderr, "EXP depth samples=%u shadowOk=%d directOk=%d useShadow=%d\n", target.samples, supports(shadowResult, shadowProperties) ? 1 : 0, directSampleable ? 1 : 0, useSampleShadow ? 1 : 0); ``` AI-assisted: yes.
Sign in to join this conversation.
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#16883
No description provided.