graphics: suballocate small guest buffers with device addresses #1389
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1389
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1389/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@overlordxrz-source on GitHub · 2026-10-10 22:41 UTC · original
overlordxrz-source:gtav/bda-suballocation→main· +9 −1 · 1 files · 1 commits · closed without mergingGame
Grand Theft Auto V (PPSA04263).
Problem
GTA V hitches when a new area of Los Santos streams in. It creates about 700 guest buffers per area and about 5000 in two minutes of play. On main, every guest buffer with a device address gets a dedicated allocation (one
vkAllocateMemoryeach,streamBuffer.cpp). Creating one took 83–91 µs on the emulated GPU's execution thread. That adds up to 330–500 ms per two-minute run, and a 68 ms stall on entering an area. Players report stutter and lag in the open world on main (#888, #971).Change
BufferCache::CreateBuffer()aligns every guest buffer to whole caching pages (16 KiB).cpu_address == 0)VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT, so suballocated blocks get device-address memory.Evidence
Validation
947627d10unchanged.streamBuffer.cppcompiles for x86_64-linux-gnu (zig 0.17 clang,-std=c++20 -Wall -Wextra).Credit
Ported from TheCruZ/KytyPS5-GTA 8f092c828 with his permission (#1241). Co-authored-by: TheCruZ.
AI-assisted: yes.
@coderabbitai[bot] on GitHub · 2026-10-10 22:45 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
d352d9a1-e1d3-4083-a787-5b3febaa827d📥 Commits
Reviewing files that changed from the base of the PR and between
947627d10dand3664446a9c.📒 Files selected for processing (1)
src/graphics/host_gpu/renderer/cache/streamBuffer.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough
Device-address buffers now request dedicated memory only when the guest CPU address is zero or the buffer exceeds 16 MiB. Buffers with a guest CPU address at or below that size use shared VMA blocks.
Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
36644Small guest-addressed buffers can now share VMA blocks; the inspected address translation preserves the correct buffer mapping, with no identified merge blocker.
Pre-merge checks |
5
✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@overlordxrz-source on GitHub · 2026-10-16 18:52 UTC · original
Superseded by
d58aefde4, which lets VMA suballocate every BDA buffer. Closing.Pull request closed