AMD Vega (Windows, driver 23.19): the last vertex of a strided fetch reads zero because the bound range ends inside its record; agc_driver_zero_vertex_fetch_ranges fails #26623

Closed
opened 2026-11-24 11:58:51 +00:00 by cryst4lpepsi · 0 comments
cryst4lpepsi commented 2026-11-24 11:58:51 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by cryst4lpepsi on 2026-11-24T11:58:51Z.


What happens

agc_driver_zero_vertex_fetch_ranges and agc_driver_zero_vertex_fetch_ranges_verify_plan fail on an AMD Vega iGPU with AMD's Windows driver 23.19, 3 of 3 runs each: live known-zero layout transition: vertex 2 v8 is 0, expected 1048576000. They pass 3 of 3 on an NVIDIA GPU in the same laptop.

What was checked

The failing case draws 3 vertices with a 32-byte stride and 16-byte elements. VertexBufferReadSize gives stride * last index + element bytes = 80 bytes, so the bound range ends inside the last record. An older local experiment (main f220c22162, not proposed) isolates this:

Change AMD Vega NVIDIA
none fails passes
The fetch's range rounded up to a whole stride (96 bytes) passes passes
robustBufferAccess (and so robustBufferAccess2) not enabled still fails passes

Robust Buffer Access lets a driver check vertex input against the range rounded down to a multiple of the binding's stride. I did not find that allowance in the Robust Buffer Access 2 section, and AnyPS5 enables robustBufferAccess2 on this device. So the driver may be at fault here, but on a device with only robustBufferAccess the same result would be allowed.

From reading the code, VertexBufferExtent (indirect draws) also ends inside the last record: (records - 1) * stride + element bytes. I have not tested an indirect draw.

Reading the added bytes from the guest needs the checks of vertexCopyTailReadable and its callers (#19100), so I am not proposing the local experiment as a fix.

Not tried: another AMD driver, a title. I do not know of a title that shows this.

Title, test or build step

agc_driver_zero_vertex_fetch_ranges, agc_driver_zero_vertex_fetch_ranges_verify_plan

AnyPS5 commit

main 72f4ebca39, nothing merged on top.

System

Windows 11 Home 22621, WinLibs GCC 15.2.0 r7, Release. AMD Radeon(TM) Graphics (Vega iGPU, 1002:1638), AMD proprietary driver 23.19.10.08. Control: NVIDIA GeForce RTX 3050 Ti Laptop GPU (10de:25a0), driver 596.36.

Steps to reproduce

ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R "^agc_driver_zero_vertex_fetch_ranges" -V

Log

AGC graphics: live known-zero layout transition: vertex 2 v8 is 0, expected 1048576000

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6581244752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/26623). Originally posted by [cryst4lpepsi](https://github.com/cryst4lpepsi) on 2026-11-24T11:58:51Z. --- ### What happens `agc_driver_zero_vertex_fetch_ranges` and `agc_driver_zero_vertex_fetch_ranges_verify_plan` fail on an AMD Vega iGPU with AMD's Windows driver 23.19, 3 of 3 runs each: `live known-zero layout transition: vertex 2 v8 is 0, expected 1048576000`. They pass 3 of 3 on an NVIDIA GPU in the same laptop. ### What was checked The failing case draws 3 vertices with a 32-byte stride and 16-byte elements. `VertexBufferReadSize` gives `stride * last index + element bytes` = 80 bytes, so the bound range ends inside the last record. An older local experiment (`main` `f220c22162`, not proposed) isolates this: | Change | AMD Vega | NVIDIA | |---|---|---| | none | fails | passes | | The fetch's range rounded up to a whole stride (96 bytes) | passes | passes | | `robustBufferAccess` (and so `robustBufferAccess2`) not enabled | still fails | passes | [Robust Buffer Access](https://docs.vulkan.org/spec/latest/chapters/shaders.html#shaders-robust-buffer-access) lets a driver check vertex input against the range rounded down to a multiple of the binding's stride. I did not find that allowance in the Robust Buffer Access 2 section, and AnyPS5 enables `robustBufferAccess2` on this device. So the driver may be at fault here, but on a device with only `robustBufferAccess` the same result would be allowed. From reading the code, `VertexBufferExtent` (indirect draws) also ends inside the last record: `(records - 1) * stride + element bytes`. I have not tested an indirect draw. Reading the added bytes from the guest needs the checks of `vertexCopyTailReadable` and its callers (#19100), so I am not proposing the local experiment as a fix. Not tried: another AMD driver, a title. I do not know of a title that shows this. ### Title, test or build step `agc_driver_zero_vertex_fetch_ranges`, `agc_driver_zero_vertex_fetch_ranges_verify_plan` ### AnyPS5 commit `main` `72f4ebca39`, nothing merged on top. ### System Windows 11 Home 22621, WinLibs GCC 15.2.0 r7, Release. AMD Radeon(TM) Graphics (Vega iGPU, `1002:1638`), AMD proprietary driver 23.19.10.08. Control: NVIDIA GeForce RTX 3050 Ti Laptop GPU (`10de:25a0`), driver 596.36. ### Steps to reproduce ``` ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R "^agc_driver_zero_vertex_fetch_ranges" -V ``` ### Log ``` AGC graphics: live known-zero layout transition: vertex 2 v8 is 0, expected 1048576000 ``` 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#26623
No description provided.