renderer: bind vertex buffers with the size of their descriptor #464

Closed
github-bot wants to merge 1 commit from gh-pr/464/head into gh-pr/464/base
Owner

@⁠brandostrong on GitHub · 2026-09-02 21:50 UTC · original
brandostrong:fix/vertex-buffer-descriptor-size → main · +5 −2 · 1 files · 1 commits · closed without merging

Problem. Vertex buffers were bound with a size derived from the draw rather than from the V#. A fetch past num_records then read whatever memory followed the buffer, where the hardware returns zero for out-of-range records (buffer descriptor clamping, RDNA2 ISA "buffer resource" section).

Change. Bind the vertex buffer with the descriptor's own size so the host's bounds behaviour lines up with the guest's.

Effect. No isolated measured change; part of the GTA V rendering bring-up where out-of-range vertex fetches showed up as garbage attributes.

Verification. Suites pass.

References

  • AMD RDNA 2 Instruction Set Architecture Reference Guide, §8.1.5 "Buffer Addressing" (range checking) and §8.1.8 "Buffer Resource": out-of-range reads return zero and out-of-range writes are dropped, judged against the V#'s num_records.
**@⁠brandostrong** on GitHub · 2026-09-02 21:50 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/464) `brandostrong:fix/vertex-buffer-descriptor-size` → `main` · +5 −2 · 1 files · 1 commits · closed without merging **Problem.** Vertex buffers were bound with a size derived from the draw rather than from the V#. A fetch past `num_records` then read whatever memory followed the buffer, where the hardware returns zero for out-of-range records (buffer descriptor clamping, RDNA2 ISA "buffer resource" section). **Change.** Bind the vertex buffer with the descriptor's own size so the host's bounds behaviour lines up with the guest's. **Effect.** No isolated measured change; part of the GTA V rendering bring-up where out-of-range vertex fetches showed up as garbage attributes. **Verification.** Suites pass. **References** - AMD RDNA 2 Instruction Set Architecture Reference Guide, §8.1.5 "Buffer Addressing" (range checking) and §8.1.8 "Buffer Resource": out-of-range reads return zero and out-of-range writes are dropped, judged against the V#'s `num_records`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:22:13 +00:00
github-bot closed this pull request 2026-11-26 09:22:13 +00:00
Author
Owner

@⁠brandostrong on GitHub · 2026-09-15 18:13 UTC · original

Closing: 3f80151a ("Respect vertex buffer sizes") makes the same change.

**@⁠brandostrong** on GitHub · 2026-09-15 18:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/464#issuecomment-5685564604) Closing: 3f80151a ("Respect vertex buffer sizes") makes the same change.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.