perf(shader): store buffer bytes and shorts with 8- and 16-bit views #4085

Closed
karanvora2599 wants to merge 1 commit from upstream-pr/4085 into main
karanvora2599 commented 2026-10-11 22:58:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-11T22:58:36Z.


What

buffer_store_byte and buffer_store_short into descriptor-bound buffers become plain 8- and 16-bit stores instead of compare-and-swap loops on the containing dword. This also fixes a dropped byte in one short-store case.

Background. The storage buffers are declared as u32 arrays (buffers), so writeBuffer merged a byte or a short into its dword with AtomicUpdate, a compare-and-swap loop. When neighbouring lanes write bytes of the same dword, which is the usual pattern, the loop retries. The device already requires storageBuffer8BitAccess, and buffers_u64 already shows the pattern of an aliased typed view for 64-bit atomics.

How.

  • Analysis. AnalyzeProgramRequirements notes raw (not formatted, not BDA) byte and short buffer stores.
  • Views. Such programs declare a u8 view buffers_u8 (StorageBuffer8BitAccess) and, for shorts, a u16 view buffers_u16 (StorageBuffer16BitAccess) of the same descriptor array. They are aliased with the others and get Coherent like buffers_u64 when the program needs it.
  • Device. VulkanDevice enables storageBuffer16BitAccess where the device has it. The capability is also added to the graphics shader validation list.
  • Byte position. In writeBuffer, a store goes to byte (byteOffset & ~3) + misalignment + address. That is where the word path puts it: dword (address >> 2) + (byteOffset >> 2), shifted by the V#'s misalignment and the address's low bits.
  • Stores. A byte is one u8 store. A short is one u16 store at an even byte, and two u8 stores at an odd one; the second is skipped if its dword is out of the bound range.
  • Fallback. The word path stays for targets without 8-bit storage, and for formatted stores in programs without raw byte/short stores.

Dropped byte. The word path shifted the short's 16-bit mask by (address & 3) * 8 first and added the V#'s misalignment afterwards. At an address that is 3 mod 4, the high byte was shifted past bit 31 and never written.

  • It is lost even when the short doesn't cross a dword: through a V# misaligned by 1, a short at address 3 sits at bytes 4–5 of the binding.
  • The same code writes both bytes when the position comes from the misalignment instead, e.g. address 2 through a V# misaligned by 1.
  • The two u8 stores write both bytes in both cases. With main's code, the new test gives buffer_store_short (word updates, base +1): byte 5 is 0x000000a5, expected 0x00000060.

Before / after on an RTX 4060 Laptop (Ada, driver 591.86):

Instruction SASS before SASS after
buffer_store_byte 47.5 15.5
buffer_store_short 47.5 15.5

SASS per instruction is the APS5_PIPELINE_STATS binary-size difference over 16 stores; the rest is the V# decode, bounds check and address math. No other memory instruction in the sweep changes.

Run time, 16,384 groups of 32 lanes, each lane storing to its own byte or short of consecutive dwords. Median of 15 interleaved dispatches in one process, with and without the views:

Kernel word updates this PR
128 × buffer_store_byte 89.7 ms 12.0 ms
64 × buffer_store_short 22.3 ms 6.6 ms

Why results don't change otherwise. The views alias the same buffer and the byte position is the word path's. A plain u8/u16 store writes exactly the bytes the masked compare-and-swap replaced, without touching the neighbours. AMD's buffer_store_byte/short are plain stores too, not read-modify-writes of the dword. The bound check on the dword is unchanged; the extra check only guards the second byte of an odd short.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, Release, main at 7c8df1f0 with #4021 applied locally (main doesn't compile libkernel on Windows without it). RTX 4060 Laptop (driver 591.86), Intel UHD Graphics (Raptor Lake, driver 101.6790), lavapipe from Mesa 25.2.8 (the version CI installs; Windows build, GALLIUM_OVERRIDE_CPU_CAPS=avx).

  • New agc_driver_buffer_subword_store:
    • All 32 lanes store bytes into adjacent bytes, and shorts at byte positions 0, 1 and 2 mod 4, of shared dwords. The V# base is misaligned by 0 to 3 bytes, and the test checks all 256 bytes of the buffer.
    • It runs with the device target and with StorageBuffer16BitAccess removed (shorts as two bytes).
    • It requires the 8- and 16-bit views in the SPIR-V exactly when the capabilities are there, and neither without 8-bit storage.
    • All three devices have both views.
  • Negative check: adding the V#'s misalignment twice, which was my first version, makes it fail: buffer_store_byte (device target, base +1): byte 3 is 0x000000a5, expected 0x00000040.
  • agc_driver_buffer_unaligned_base, agc_driver_buffer_load_store, agc_driver_d16_memory, agc_driver_formatted_store and agc_driver_format_d16_store pass on all three devices.
  • Shader tests (agc_driver_*, agc_shader_*, agc_spirv_*, vector_*, agc_masked_select, agc_validate_program, agc_denormal*, agc_float16_*; 320 tests). The BDA tests that hang on driver 591.86 until #3291 lands are left out.
    • RTX 4060: everything passes except agc_driver_prepared_shaders_registered_workgroup_sync, which fails the same way (expected preparation failure) on a build without this change.
    • Intel UHD: the same, plus agc_driver_ds_swizzle and agc_driver_f32_dot2_rounding (no Float64; it throws instead of skipping), which fail the same way with main's recompiler. agc_driver_gated_dispatch_capture failed during the suite and passed twice on its own.
    • lavapipe 25.2.8: the same registered_workgroup_sync failure and the intermittent agc_driver_depth_fast_clear_submit segfault that also happens with main's recompiler.

Limits.

  • I haven't run it on AMD hardware.
  • A byte store racing a 32-bit atomic on the same dword was two atomics before. It is now a plain store and an atomic, which the Vulkan memory model calls a race; the hardware handles it, but that interleaving isn't tested.
  • A short at an odd address is now two byte stores. Where the compare-and-swap wrote both bytes at once, two racing stores that overlap (two shorts, or a short and a byte on one of its bytes) can now leave bytes from both writers. That isn't tested either.
  • Formatted 8/16-bit stores keep the word path unless the program also has raw byte/short stores, in which case they use the views too.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4823032125 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085). Originally posted by [karanvora2599](https://github.com/karanvora2599) on 2026-10-11T22:58:36Z. --- ### What `buffer_store_byte` and `buffer_store_short` into descriptor-bound buffers become plain 8- and 16-bit stores instead of compare-and-swap loops on the containing dword. This also fixes a dropped byte in one short-store case. **Background.** The storage buffers are declared as `u32` arrays (`buffers`), so `writeBuffer` merged a byte or a short into its dword with `AtomicUpdate`, a compare-and-swap loop. When neighbouring lanes write bytes of the same dword, which is the usual pattern, the loop retries. The device already requires `storageBuffer8BitAccess`, and `buffers_u64` already shows the pattern of an aliased typed view for 64-bit atomics. **How.** - **Analysis.** `AnalyzeProgramRequirements` notes raw (not formatted, not BDA) byte and short buffer stores. - **Views.** Such programs declare a `u8` view `buffers_u8` (`StorageBuffer8BitAccess`) and, for shorts, a `u16` view `buffers_u16` (`StorageBuffer16BitAccess`) of the same descriptor array. They are aliased with the others and get `Coherent` like `buffers_u64` when the program needs it. - **Device.** `VulkanDevice` enables `storageBuffer16BitAccess` where the device has it. The capability is also added to the graphics shader validation list. - **Byte position.** In `writeBuffer`, a store goes to byte `(byteOffset & ~3) + misalignment + address`. That is where the word path puts it: dword `(address >> 2) + (byteOffset >> 2)`, shifted by the V#'s misalignment and the address's low bits. - **Stores.** A byte is one `u8` store. A short is one `u16` store at an even byte, and two `u8` stores at an odd one; the second is skipped if its dword is out of the bound range. - **Fallback.** The word path stays for targets without 8-bit storage, and for formatted stores in programs without raw byte/short stores. **Dropped byte.** The word path shifted the short's 16-bit mask by `(address & 3) * 8` first and added the V#'s misalignment afterwards. At an address that is 3 mod 4, the high byte was shifted past bit 31 and never written. - It is lost even when the short doesn't cross a dword: through a V# misaligned by 1, a short at address 3 sits at bytes 4–5 of the binding. - The same code writes both bytes when the position comes from the misalignment instead, e.g. address 2 through a V# misaligned by 1. - The two `u8` stores write both bytes in both cases. With `main`'s code, the new test gives `buffer_store_short (word updates, base +1): byte 5 is 0x000000a5, expected 0x00000060`. **Before / after** on an RTX 4060 Laptop (Ada, driver 591.86): | Instruction | SASS before | SASS after | |---|---|---| | `buffer_store_byte` | 47.5 | 15.5 | | `buffer_store_short` | 47.5 | 15.5 | SASS per instruction is the `APS5_PIPELINE_STATS` binary-size difference over 16 stores; the rest is the V# decode, bounds check and address math. No other memory instruction in the sweep changes. Run time, 16,384 groups of 32 lanes, each lane storing to its own byte or short of consecutive dwords. Median of 15 interleaved dispatches in one process, with and without the views: | Kernel | word updates | this PR | |---|---|---| | 128 × `buffer_store_byte` | 89.7 ms | 12.0 ms | | 64 × `buffer_store_short` | 22.3 ms | 6.6 ms | **Why results don't change otherwise.** The views alias the same buffer and the byte position is the word path's. A plain `u8`/`u16` store writes exactly the bytes the masked compare-and-swap replaced, without touching the neighbours. AMD's `buffer_store_byte/short` are plain stores too, not read-modify-writes of the dword. The bound check on the dword is unchanged; the extra check only guards the second byte of an odd short. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, Release, `main` at 7c8df1f0 with #4021 applied locally (`main` doesn't compile `libkernel` on Windows without it). RTX 4060 Laptop (driver 591.86), Intel UHD Graphics (Raptor Lake, driver 101.6790), lavapipe from Mesa 25.2.8 (the version CI installs; Windows build, `GALLIUM_OVERRIDE_CPU_CAPS=avx`). - New `agc_driver_buffer_subword_store`: - All 32 lanes store bytes into adjacent bytes, and shorts at byte positions 0, 1 and 2 mod 4, of shared dwords. The V# base is misaligned by 0 to 3 bytes, and the test checks all 256 bytes of the buffer. - It runs with the device target and with `StorageBuffer16BitAccess` removed (shorts as two bytes). - It requires the 8- and 16-bit views in the SPIR-V exactly when the capabilities are there, and neither without 8-bit storage. - All three devices have both views. - Negative check: adding the V#'s misalignment twice, which was my first version, makes it fail: `buffer_store_byte (device target, base +1): byte 3 is 0x000000a5, expected 0x00000040`. - `agc_driver_buffer_unaligned_base`, `agc_driver_buffer_load_store`, `agc_driver_d16_memory`, `agc_driver_formatted_store` and `agc_driver_format_d16_store` pass on all three devices. - Shader tests (`agc_driver_*`, `agc_shader_*`, `agc_spirv_*`, `vector_*`, `agc_masked_select`, `agc_validate_program`, `agc_denormal*`, `agc_float16_*`; 320 tests). The BDA tests that hang on driver 591.86 until #3291 lands are left out. - RTX 4060: everything passes except `agc_driver_prepared_shaders_registered_workgroup_sync`, which fails the same way (`expected preparation failure`) on a build without this change. - Intel UHD: the same, plus `agc_driver_ds_swizzle` and `agc_driver_f32_dot2_rounding` (no `Float64`; it throws instead of skipping), which fail the same way with `main`'s recompiler. `agc_driver_gated_dispatch_capture` failed during the suite and passed twice on its own. - lavapipe 25.2.8: the same `registered_workgroup_sync` failure and the intermittent `agc_driver_depth_fast_clear_submit` segfault that also happens with `main`'s recompiler. **Limits.** - I haven't run it on AMD hardware. - A byte store racing a 32-bit atomic on the same dword was two atomics before. It is now a plain store and an atomic, which the Vulkan memory model calls a race; the hardware handles it, but that interleaving isn't tested. - A short at an odd address is now two byte stores. Where the compare-and-swap wrote both bytes at once, two racing stores that overlap (two shorts, or a short and a byte on one of its bytes) can now leave bytes from both writers. That isn't tested either. - Formatted 8/16-bit stores keep the word path unless the program also has raw byte/short stores, in which case they use the views too. ### Checklist - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
Dextroid17 commented 2026-10-12 01:29:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T01:29:16Z.


The dropped-byte claim checks out exactly, with a concrete number: at address 3 with a V# misalignment of 1, the old code shifts the 16-bit mask by the address-derived offset before adding the misalignment, so the high byte's bits end up shifted past bit 31 and are simply gone — not wrapped, not corrupted, just never written. The new path can't inherit that bug by construction: it computes the same byte position once and writes it directly (two single-byte stores, or one aligned 16-bit store), with no left-shift of the value that could push a byte out of range.

The capability gating is real and correctly structured both ways — the 8-bit and 16-bit SPIR-V views are only declared when the corresponding capability is present, and the device only advertises storageBuffer16BitAccess when the physical device actually reports it, so there's no path where this emits for an unsupported target. The word path genuinely survives as a fallback for devices without 8-bit storage and for formatted stores that don't also need raw access.

One thing worth adding to the PR's own race disclosure, since it's real but goes further than what's written: the body correctly flags that a byte store racing a 32-bit atomic on the same dword is now a plain-store-vs-atomic race that wasn't one before. What it doesn't mention is that the two individual stores of an odd-aligned short are also no longer atomic with each other, and neither is a short-store against a byte-store landing on one of its bytes — the old single compare-and-swap covered both bytes of a short at once and gave overlapping writers a defined winner; two independent plain stores don't. Worth a line in the PR acknowledging this is a second, distinct untested race, not just the one case named.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116139746 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085#issuecomment-6116139746). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T01:29:16Z. --- The dropped-byte claim checks out exactly, with a concrete number: at address 3 with a V# misalignment of 1, the old code shifts the 16-bit mask by the address-derived offset *before* adding the misalignment, so the high byte's bits end up shifted past bit 31 and are simply gone — not wrapped, not corrupted, just never written. The new path can't inherit that bug by construction: it computes the same byte position once and writes it directly (two single-byte stores, or one aligned 16-bit store), with no left-shift of the value that could push a byte out of range. The capability gating is real and correctly structured both ways — the 8-bit and 16-bit SPIR-V views are only declared when the corresponding capability is present, and the device only advertises `storageBuffer16BitAccess` when the physical device actually reports it, so there's no path where this emits for an unsupported target. The word path genuinely survives as a fallback for devices without 8-bit storage and for formatted stores that don't also need raw access. One thing worth adding to the PR's own race disclosure, since it's real but goes further than what's written: the body correctly flags that a byte store racing a 32-bit atomic on the same dword is now a plain-store-vs-atomic race that wasn't one before. What it doesn't mention is that the two individual stores of an odd-aligned short are *also* no longer atomic with each other, and neither is a short-store against a byte-store landing on one of its bytes — the old single compare-and-swap covered both bytes of a short at once and gave overlapping writers a defined winner; two independent plain stores don't. Worth a line in the PR acknowledging this is a second, distinct untested race, not just the one case named. Written with AI assistance.
karanvora2599 commented 2026-10-12 02:31:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-12T02:31:58Z.


Thanks @Dextroid17, that's a second case, and I've added it to the limits. A short at an odd address is now two byte stores, so two racing stores that overlap (two shorts, or a short and a byte on one of its bytes) can leave bytes from both writers, where the compare-and-swap wrote both bytes at once. Like the atomic case, it isn't tested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116697049 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085#issuecomment-6116697049). Originally posted by [karanvora2599](https://github.com/karanvora2599) on 2026-10-12T02:31:58Z. --- Thanks @Dextroid17, that's a second case, and I've added it to the limits. A short at an odd address is now two byte stores, so two racing stores that overlap (two shorts, or a short and a byte on one of its bytes) can leave bytes from both writers, where the compare-and-swap wrote both bytes at once. Like the atomic case, it isn't tested.
simonbbby commented 2026-10-12 18:14:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-12T18:14:29Z.


Rechecked head 4bcdb818 on Linux using a synthetic pixel-shader validation probe, against main 3d8ffeb2.

Base accepts all 10 cases. With this PR, all 8 byte/short-store cases fail ValidateShaders with AGC graphics: unsupported SPIR-V extension; both dword controls pass. The cases cover offsets 0 and 3 with requested BDA ABI versions 0 and 1. The relevant validator file is unchanged through current main 2a5eca11.

The generated shaders declare SPV_KHR_8bit_storage, which the graphics validator refuses on this path. Compute tests do not exercise that validator. Could this PR include graphics validation coverage and acceptance of the emitted u8/u16 views?

This checks shader generation and validation, not a real draw. Ubuntu 24.04, GCC 13.3, Release, SPIRV-Tools enabled.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6129975102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085#issuecomment-6129975102). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-12T18:14:29Z. --- Rechecked head `4bcdb818` on Linux using a synthetic pixel-shader validation probe, against `main` `3d8ffeb2`. Base accepts all 10 cases. With this PR, all 8 byte/short-store cases fail `ValidateShaders` with `AGC graphics: unsupported SPIR-V extension`; both dword controls pass. The cases cover offsets 0 and 3 with requested BDA ABI versions 0 and 1. The relevant validator file is unchanged through current `main` `2a5eca11`. The generated shaders declare `SPV_KHR_8bit_storage`, which the graphics validator refuses on this path. Compute tests do not exercise that validator. Could this PR include graphics validation coverage and acceptance of the emitted u8/u16 views? This checks shader generation and validation, not a real draw. Ubuntu 24.04, GCC 13.3, Release, SPIRV-Tools enabled.
oneandonlydean commented 2026-10-13 02:42:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:42:35Z.


Graphics shaders with a raw byte or short store no longer pass validation with this. The module now declares SPV_KHR_8bit_storage, and ShaderValidation.cpp:310 accepts that extension only with the BDA ABI, so they fail with unsupported SPIR-V extension (simonbbby's probe above, 8 of 8 cases). Please accept the u8/u16 views there, add a graphics validation case, and rebase: SpirvRuntimeBuffer.cpp and SpirvEmitterHelpers.cpp have changed on main since.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6137033408 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085#issuecomment-6137033408). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:42:35Z. --- Graphics shaders with a raw byte or short store no longer pass validation with this. The module now declares `SPV_KHR_8bit_storage`, and `ShaderValidation.cpp:310` accepts that extension only with the BDA ABI, so they fail with `unsupported SPIR-V extension` (simonbbby's probe above, 8 of 8 cases). Please accept the u8/u16 views there, add a graphics validation case, and rebase: `SpirvRuntimeBuffer.cpp` and `SpirvEmitterHelpers.cpp` have changed on main since.
adriadam10 commented 2026-10-13 10:50:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T10:50:01Z.

Review: CHANGES_REQUESTED


Agreeing with the points above; the blocker is confirmed on the current code:

  • core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp:332 accepts SPV_KHR_8bit_storage only when shader.bdaAbiVersion == ShaderRecompiler::BdaAbi::Version, and the diff only adds CapabilityStorageBuffer16BitAccess to the capability list (line 280). Any graphics shader with a raw buffer_store_byte/buffer_store_short now declares the extension and fails with unsupported SPIR-V extension, which compute tests don't exercise. Accept the extension(s) the new views need (including SPV_KHR_16bit_storage if the module declares it) when the device has the features, not only with the BDA ABI.
  • Add a graphics validation case (pixel/vertex shader with a byte store and a short store, offsets 0 and 3) that fails without the change.
  • Rebase: SpirvRuntimeBuffer.cpp and SpirvEmitterHelpers.cpp changed on main since. Rerun the new test after the rebase.

I'll measure the store semantics on hardware once this is updated.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5502388888 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085#pullrequestreview-5502388888). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T10:50:01Z. **Review:** CHANGES_REQUESTED --- Agreeing with the points above; the blocker is confirmed on the current code: - `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp:332` accepts `SPV_KHR_8bit_storage` only when `shader.bdaAbiVersion == ShaderRecompiler::BdaAbi::Version`, and the diff only adds `CapabilityStorageBuffer16BitAccess` to the capability list (line 280). Any graphics shader with a raw `buffer_store_byte`/`buffer_store_short` now declares the extension and fails with `unsupported SPIR-V extension`, which compute tests don't exercise. Accept the extension(s) the new views need (including `SPV_KHR_16bit_storage` if the module declares it) when the device has the features, not only with the BDA ABI. - Add a graphics validation case (pixel/vertex shader with a byte store and a short store, offsets 0 and 3) that fails without the change. - Rebase: `SpirvRuntimeBuffer.cpp` and `SpirvEmitterHelpers.cpp` changed on main since. Rerun the new test after the rebase. I'll measure the store semantics on hardware once this is updated.
karanvora2599 commented 2026-10-13 21:55:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-13T21:55:07Z.


Thanks @simonbbby for the probe, and @oneandonlydean and @adriadam10 for confirming it. You're right: I only ran the byte and short views through compute, and ValidateShaders doesn't check compute. Next push:

  • Rebase: onto current main, which now has #4250's buffers_u8 view for formatted 8- and 16-bit stores in compute. This PR will reuse that view for buffer_store_byte and the odd-address short, so there is one u8 declaration, and add buffers_u16 next to it.
  • Validator: ShaderValidation.cpp accepts SPV_KHR_8bit_storage, SPV_KHR_16bit_storage and StorageBuffer16BitAccess when the device has storageBuffer8BitAccess / storageBuffer16BitAccess, not only with the BDA ABI. It also accepts u8 and u16 runtime arrays in aliased guest-buffer views, next to the u64 view from #4381.
  • Test: a graphics validation case with a pixel and a vertex shader, each with a byte store and a short store at offsets 0 and 3. It fails on the current head.
  • Checks: I'll rerun the new case, the buffer store tests and #4250's byte-store test.

#4250 keeps the compare-exchange path for formatted stores outside compute. Once the validator accepts the views, those stores could use them in graphics as well, but I'd leave that to a separate PR.

I'll post here when it's up.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156018186 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085#issuecomment-6156018186). Originally posted by [karanvora2599](https://github.com/karanvora2599) on 2026-10-13T21:55:07Z. --- Thanks @simonbbby for the probe, and @oneandonlydean and @adriadam10 for confirming it. You're right: I only ran the byte and short views through compute, and `ValidateShaders` doesn't check compute. Next push: - **Rebase:** onto current `main`, which now has #4250's `buffers_u8` view for formatted 8- and 16-bit stores in compute. This PR will reuse that view for `buffer_store_byte` and the odd-address short, so there is one u8 declaration, and add `buffers_u16` next to it. - **Validator:** `ShaderValidation.cpp` accepts `SPV_KHR_8bit_storage`, `SPV_KHR_16bit_storage` and `StorageBuffer16BitAccess` when the device has `storageBuffer8BitAccess` / `storageBuffer16BitAccess`, not only with the BDA ABI. It also accepts u8 and u16 runtime arrays in aliased guest-buffer views, next to the u64 view from #4381. - **Test:** a graphics validation case with a pixel and a vertex shader, each with a byte store and a short store at offsets 0 and 3. It fails on the current head. - **Checks:** I'll rerun the new case, the buffer store tests and #4250's byte-store test. #4250 keeps the compare-exchange path for formatted stores outside compute. Once the validator accepts the views, those stores could use them in graphics as well, but I'd leave that to a separate PR. I'll post here when it's up.
oneandonlydean commented 2026-10-14 02:39:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:39:09Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159660099 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4085#issuecomment-6159660099). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:39:09Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

Pull request closed

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!4085
No description provided.