graphics: hoist loop-invariant checks out of draw/attrib hot paths #807
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!807
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/807/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?
@romainhedouin on GitHub · 2026-09-24 14:11 UTC · original
romainhedouin:optimize-drawindirect-shader-loops→main· +16 −10 · 3 files · 2 commits · merged 2026-09-24 17:02 UTCSummary
CommandProcessor::DrawIndirectMultirecomputed them_index_type_and_sizeswitch (derivingindex_size) on every sub-draw of a multi-draw-indirect call. The value is invariant across the loop, so it's now computed once before iterating.ShaderApplyAttribSemanticsre-evaluatedConfig::GraphicsDebugDumpEnabled()on every vertex attribute (up to 32 per call). Hoisted into a single localboolbefore the loop.AcquireVertexBufferscalledVertexBufferDescriptorSizetwice per vertex-buffer slot on every draw call (once while collecting guest ranges, again while rebuilding slot bindings) with identical inputs both times. The first pass's result is now cached and reused.All three are pure loop-invariant hoists / redundant-call elimination with no behavior change.
@coderabbitai[bot] on GitHub · 2026-09-24 14:17 UTC · original · edited 2026-09-24 14:27 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
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
7d74b1b8-0e3e-4661-88c3-f0f43d4dd602📥 Commits
Reviewing files that changed from the base of the PR and between
ecfa5412a5andf1d4c6e638.📒 Files selected for processing (1)
src/graphics/host_gpu/renderer/renderDraw.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough
DrawIndirectMulti selects the index-element size once for indexed draws and reuses it when calculating each draw's index address. ShaderApplyAttribSemantics caches the graphics debug-dump setting before processing input semantics and uses it to gate per-attribute logging. AcquireVertexBuffers records each vertex descriptor size by slot and reuses it during binding setup.
Suggested reviewers:
nmzikMerge Risk: ⚪ Minimal · up to
f1d4cThe cached values preserve the behavior described for these operations, and no actionable merge risk remains.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment
@coderabbitai helpto get the list of available commands.