Teardown in-game #1066
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!1066
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1066/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?
@joaodiaslobo on GitHub · 2026-10-05 10:45 UTC · original
joaodiaslobo:teardown-compat→main· +35 −6 · 3 files · 2 commits · closed without mergingTeardown (PPSA15246) now boots and reaches gameplay.
On current main, Teardown crashes before the main menu (#707, #817): one of its compute shaders binds buffers with
NUM_RECORDS = 0xFFFFFFFF(unbounded), and the renderer tries to allocate a host buffer covering the whole clamped range (~12.5 GB), which fails instreamBuffer.cpp. After loading a level, the game issues indexed indirect draws withSOURCE_SELECT = 0(DMA), which the command processor rejected.Fixes:
DRAW_INDEX_INDIRECT/DRAW_INDEX_INDIRECT_MULTIpackets accept source select 0 or 2; non-indexed draws still require 2.maxStorageBufferRange; unbounded written buffers end before the nearest guest range read during resource specialization by any bound stage, so the write range cannot overlap descriptor tables the draw or dispatch reads.Testing:
Windows Release build. Teardown boots, loads a level and is playable (has some shadow flickering).
@coderabbitai[bot] on GitHub · 2026-10-05 10:50 UTC · original · edited 2026-10-05 11:31 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
7eb1c1e5-784f-43cd-91ea-a1e6a8efcf22📥 Commits
Reviewing files that changed from the base of the PR and between 389000f168d8d8a42db15eeaf6cb4557a3878e96 and
7b2ec7082a.📒 Files selected for processing (1)
src/graphics/host_gpu/renderer/pipeline/descriptors.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
📝 Walkthrough
Walkthrough
Indirect draw entry points now use a shared check for supported source-select values. The renderer’s buffer lookup accepts prepared-stage bindings, caps qualifying requests at 256 MiB or the device limit, and adjusts written-buffer ranges based on specialization-read addresses.
Suggested reviewers:
defektuPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
7b2ecThe previously identified buffer-binding failures are addressed at the reviewed head. No actionable merge-blocking risk remains after normal checks.
Security Architecture Review
Security architecture risk: 🔵 Low · up to
7b2ecThe change reduces oversized memory requests and retains existing overlap rejection. No new authority or confirmed isolation failure was established, but behavior beyond shortened buffer boundaries remains incompletely verified.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 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.@coderabbitai[bot] on GitHub · 2026-10-05 10:50 UTC · original
On
src/graphics/host_gpu/renderer/pipeline/descriptors.cppline 837 (outdated):🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 7660
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 22767
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 15376
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 12364
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 1208
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 1468
Include reads from every bound stage when sizing written buffers.
If another stage’s read starts before the cutoff selected from the writer stage’s snapshot,
FindBufferscan leave that read inside the written range.CommitBindingsthen reaches its shader-buffer overlapEXITinstead of binding. Use the smallest qualifying read offset across all bound stages.Suggested fix
📝 Committable suggestion
@coderabbitai[bot] on GitHub · 2026-10-05 10:50 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
99d9d7e9-e69d-45c1-827d-efdc4d3397aa📥 Commits
Reviewing files that changed from the base of the PR and between
72e4989b1eand 74a1795611aabe003e1ecdd13d8b237873d269cb.📒 Files selected for processing (2)
src/graphics/guest_gpu/graphicsRun.cppsrc/graphics/host_gpu/renderer/pipeline/descriptors.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@ -830,2 +835,4 @@continue;}if (descriptor.NumRecords() == UINT32_MAX && requested_size > unbounded_window) {requested_size = unbounded_window;@coderabbitai[bot] on GitHub · 2026-10-05 11:02 UTC · original
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Keep the unbounded window within the device’s storage-buffer limit.
If
maxStorageBufferRangeis below 256 MiB, this cap still sends an oversized source toNativeStorageBuffer, which callsEXIT. An alignment adjustment can also make a 256 MiB source exceed the limit. Size the window for the device limit and leave room for the required alignment adjustment before callingFindBuffer. (docs.vulkan.org)@coderabbitai[bot] on GitHub · 2026-10-05 11:02 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
55bdb63a-3a5c-42eb-8ae7-99c09bdfc145📥 Commits
Reviewing files that changed from the base of the PR and between 74a1795611aabe003e1ecdd13d8b237873d269cb and 412aa1ba1f47113e02fba630b3b2360939835417.
📒 Files selected for processing (2)
src/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/host_gpu/renderer/render.hIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
@ -832,0 +850,4 @@}if (requested_size == 0) {EXIT("unbounded written buffer starts at a scalar resource read\n");}@coderabbitai[bot] on GitHub · 2026-10-05 11:16 UTC · original
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 30864
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 22851
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 7077
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 9979
Reject this overlap instead of binding the null buffer.
For an oversized unbounded written buffer, a specialization read at its base reduces
requested_sizeto zero.NativeStorageBufferthen binds the 16-byteNULL_BUFFER_IDbuffer, so shader stores do not reach the guest buffer. A supported structured-vector read can start at its base when its byte offset is zero. Snapshot the read safely or reject the overlap; do not replace the write target.@coderabbitai[bot] on GitHub · 2026-10-05 11:16 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
4a9f889e-d57a-4d81-b75a-5e71c6a3dd92📥 Commits
Reviewing files that changed from the base of the PR and between 412aa1ba1f47113e02fba630b3b2360939835417 and 389000f168d8d8a42db15eeaf6cb4557a3878e96.
📒 Files selected for processing (1)
src/graphics/host_gpu/renderer/pipeline/descriptors.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
@Nmzik on GitHub · 2026-10-06 14:07 UTC · original
@joaodiaslobo Merged with main
e5dcfdb87b. Second issueindexed DRAW_INDEX_INDIRECT / DRAW_INDEX_INDIRECT_MULTI packets accept source select 0 or 2; non-indexed draws still require 2 is wrongAGC driver bug we had. Thanks!Pull request closed