Skip to content

fix(agc): back large pixel LDS with the storage buffer on Intel's Windows driver - #21683

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
androidbaklava:fix/agc-intel-pixel-lds-buffer
Nov 25, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
androidbaklava:fix/agc-intel-pixel-lds-buffer

Conversation

@androidbaklava

Copy link
Copy Markdown
Contributor

What

On Intel's Windows driver, a pixel shader that keeps the full 8192-dword LDS in a per-invocation Function array loses the device: agc_driver_pixel_lds_limit fails every run with vkWaitForFences graphics: Vulkan result -4 on Intel UHD Graphics (#12522). The storage-buffer pool that NVIDIA proprietary already uses for arrays above pixelFunctionStorageDwords needs no vendor data (it sizes itself from maxStorageBufferRange), so this enables it for VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS as well. Without VK_NV_shader_sm_builtins the threshold stays at the default 4096 dwords. The shader debt entry now names the Intel measurement.

Part of #12522: this fixes the pixel_lds_limit device loss only; the other failures listed there are unchanged.

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.

  • agc_driver_pixel_lds_limit: fails on main with device loss in 3 of 3 runs; passes 3 of 3 with this change, including the overflow case that only runs with the buffer pool (pixel LDS limit overflow passed).
  • All 50 tests matching ^agc_driver_.*(pixel|lds|ps_|fragment) with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: main 49 of 50 (only pixel_lds_limit fails), this change 50 of 50.
  • Validation: ctest -R "^agc_driver_pixel_lds" -V on main and on this change with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer and the LunarG SDK 1.4.363 layer. Each log shows Insert instance layer "VK_LAYER_KHRONOS_validation" for all four tests, neither contains was not found but was requested by env var VK_INSTANCE_LAYERS, and both have 0 VUID- lines.

Not tested on Intel Arc or on Linux (the Mesa ANV driver is unchanged).

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 docs agc libSceAgc* labels 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 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7643 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9289 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10652 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12828 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16571 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16831 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 17056 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20030 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20111 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20172 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20186 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20248 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21059 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21238 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22071 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22190 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22531 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 23058 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 24327 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 24661 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 25010 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 26165 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 18, 2026

@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

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head c622d4de54123f16940016a92980b3668e4e9a78. I read the prepared description, commits, manifest, diff, and the changed VulkanDevice.cpp context through repo_read.py. No commands or tests were run.

Results

Check Result Note
Diff review passed Both changed hunks inspected
Tests not run Author-reported results only

Findings

Blocking

None.

Non-blocking

None.

Not verified

The description reports Windows 11 Intel UHD results, but I did not run or independently verify them. The files.json inventory was unavailable through the reader. The VulkanDevice.cpp full text was excluded from the review folder; I inspected the changed function context only. docs/dev/debt/shader.md full text was listed as included, but I did not retrieve it from the reader. No other repository context, tests, or runtime behavior was verified.

To get this to a good state

Nothing is required.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 19, 2026
@Colewiz7

Copy link
Copy Markdown
Contributor

Head 92d83ca05c merged onto main 7c836568c8 as 61145cbf56, no conflict. Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036).

No new failures and no new validation messages on either GPU.

RX 7900 XT iGPU
tests run (6206 on the 7900 XT, the 2007 GPU ones on the iGPU), new failures vs main none none
-R '^agc' (1940 tests) with the layer, new failures vs main none none
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Layer runs used VK_LAYER_KHRONOS_validation 1.4.363.1 with VK_LOADER_DEBUG=layer and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; the loader inserted the layer in every run, and the set of distinct validation messages matches main.

AI-assisted: yes

@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 92d83ca merged onto main fc973e0

agc_driver_pixel_lds_limit on Intel: main fails 3/3 with vkWaitForFences graphics: Vulkan result -4, this PR passes 3/3 (pixel LDS limit overflow passed). the other 3 pixel_lds tests still pass. NVIDIA passes everything before and after.

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 — looks good

The change enables the existing large pixel LDS buffer path for Intel proprietary Windows drivers; no blocking defect is evident in the inspected code.

What I ran

Reviewed head 92d83ca05c1511f1a7f17820e390ddbb658ebf2b. Read the prepared description, commits, manifest and diff, plus the changed debt note and targeted source context via repo_read.py. No tests were run in this review.

Results

Check Result Note
Diff and targeted code review passed The new driver condition selects the existing buffer fallback.
Tests in this review not run The PR description reports Intel Windows runs; not independently verified here.

Findings

Blocking

None.

Non-blocking

None.

Not verified

Did not run tests or independently verify the author-reported Windows results. Reviewed changed files: core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp (changed line and nearby device setup), docs/dev/debt/changes/fix-agc-intel-pixel-lds-buffer.md (full file). files.json was not available in the prepared bundle; the manifest lists these two changed files, and both were read. No changed files were excluded from review.

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 92d83ca05c, applied with git apply on main fd4aeed483 together with the other 28 PRs of one batch (#22366, #22943, #23994, #24150, #24483, #14625, #16796, #17425, #20528, #22589, #22887, #14505, #16792, #17900, #18484, #20048, #20099, #20517, #21636, #22886, #23659, #23880, #24047, #24100, #24248, #16353, #21714, #22276). 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
none: no test of its own in this PR - -

Whole batch: the full ctest -j 12 (6522 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. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): public_headers. The 2125 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 device loss 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 92d83ca05c 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_pixel_lds" -V -j 1, 3 rounds, alternating main and this PR.

Test main this PR
agc_driver_pixel_lds_limit fails 3 of 3 (vkWaitForFences graphics: Vulkan result -4) passes 3 of 3, including pixel LDS limit overflow passed
agc_driver_pixel_lds, _lane_slots, _read_modify_write pass 3 of 3 pass 3 of 3

Every log shows Insert instance layer "VK_LAYER_KHRONOS_validation" for all 4 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

@Script-hpp

Copy link
Copy Markdown
Contributor

ANV data point for the same test on Linux, where the failure is different: on main f220c22162, agc_driver_pixel_lds_limit fails at pipeline creation instead of losing the device:

AGC graphics: vkCreateGraphicsPipelines library: Vulkan result -2

Intel Arc B390 (Panther Lake, Xe3), Mesa 26.2.7 ANV, Fedora 44, Linux 7.2.10, GCC Release. Adding VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA to the same largePixelFunctionLdsBuffer condition makes it pass:

^agc_driver_.*(pixel|lds|ps_|fragment), 51 tests, -j1
main 49/51: pixel_lds_limit and pixel_barycentric_emulation fail
main + ANV in the condition 50/51: only pixel_barycentric_emulation fails (fixed separately by #24294)

agc_driver_pixel_lds_limit passed 3 of 3 runs with the change, including pixel LDS limit overflow passed. Env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer (validation layer 1.4.341). Every log shows Insert instance layer "VK_LAYER_KHRONOS_validation", none shows was not found but was requested by env var VK_INSTANCE_LAYERS, and neither side logs a VUID- line.

Would you consider including Mesa ANV in this PR? If you'd rather keep it to the Windows driver, I can open a follow-up once this merges.

@androidbaklava

Copy link
Copy Markdown
Contributor Author

@Script-hpp Thanks for testing on ANV. I would rather keep this PR to the Windows driver: it's already been tested on three Intel Windows machines, and I can't test Linux or Arc here. Please open the follow up once this merges. Your table already makes the case for it.

@Script-hpp

Copy link
Copy Markdown
Contributor

Thanks, makes sense. I'll open the ANV follow-up once this merges.

@BharatYadav007

Copy link
Copy Markdown
Contributor

Independent Windows hardware validation on main 7f99fbd60d plus this PR at 92d83ca05c. 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 pixel LDS family goes from 3/4 passing on main to 4/4 with this PR. agc_driver_pixel_lds_limit fails 3/3 on main and passes 3/3 with this PR including the overflow case.
  • RTX 4050: all 4/4 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

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

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants