Increase particle and segment render-buffer pool capacities - #165
Increase particle and segment render-buffer pool capacities#165zhanghm18GIT wants to merge 6 commits into
Conversation
|
Warning Review limit reached
Next review available in: 16 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe particle renderer hooks increase the render-buffer pool from 400 to 4096 entries and the segment-buffer pool from 100 to 400 entries. The changelog documents these capacity changes. ChangesParticle pool capacity
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| @@ -0,0 +1,12 @@ | |||
| asm( | |||
There was a problem hiding this comment.
Updated to the new .hook format as suggested. The patch still changes only the two immediate pool-count values at 0x004928ED and 0x004929B2; the functional binary changes are unchanged.
The memo
Summary
This PR raises two fixed render-resource pool counts created by the particle renderer during initialization:
400 -> 4096;100 -> 400.The native pool, checkout, release, recycling, and exhaustion behavior remains unchanged. The patch increases the number of descriptors available before the existing pool-exhaustion path is reached.
The change is limited to the two initialization loop counts. Lua, simulation, synchronization, effect lifetime, per-buffer capacity, and renderer control flow are unchanged.
Problem
The initialization routine at
0x004928A0constructs two render-resource pools using fixed loop counts.Particle render-buffer pool
At
0x004928ED:The construction loop allocates
0x2C-byte descriptors. Each descriptor retains the native capacity of0xC8(200).The original fixed capacity is therefore:
Particle-heavy battles and effect-heavy mods can exhaust this fixed descriptor pool. When no descriptor is available, the existing engine path cannot provide another render buffer until resources return to the pool.
Segment-buffer pool
At
0x004929B2:This is a separate construction loop for
0x18-byte segment-buffer descriptors. The existing per-buffer creation argument of0x190remains unchanged.Implementation
The patch uses the repository's current fixed-address
.hookformat and changes only the two loop-count immediates.hooks/ParticlePoolCapacity.hookParticle render-buffer descriptor count
Exact bytes:
Segment-buffer descriptor count
Exact bytes:
Both replacement instructions remain eight bytes long.
The decrement-and-branch loops, allocation sizes, list insertion, resource release, resource recycling, and native exhaustion guards remain unchanged.
Resulting fixed capacities
Memory and performance impact
The initialization loops allocate descriptor objects of
0x2Cand0x18bytes respectively.The additional descriptor payload is:
Allocator metadata is not included in this figure.
The patch adds no runtime branch, lookup, thread, periodic scan, dynamic table, or per-particle instruction. Its direct CPU cost is the one-time initialization of the additional descriptors.
Workloads that exceed the original limits can continue using additional render resources up to the new fixed capacities. In those workloads, CPU work, GPU work, process memory, and video-memory use can increase because effects that previously reached the original pool ceiling can continue to be processed.
The renderer remains bounded by the new fixed pool sizes and continues to use the native resource-recycling and exhaustion paths.
Validation performed
Repository and source review
FAForever/FA-Binary-Patchesmaster commit96af320e872a083fdb302fde7406d6d7f17c418d;.hookformat for fixed-address assembly patches, following maintainer review feedback;hooks/ParticlePoolCapacity.hookandchangelog.md.Instruction and control-flow validation
JNEcontrol flow remains unchanged;MOVinstructions do not alter general-purpose registers or EFLAGS.Binary reconstruction
Tested baseline:
Known local particle-pool candidate:
Applying only the two immediate replacements to the baseline reproduces the known candidate byte-for-byte.
The candidate differs from the baseline at exactly four byte positions:
The PE entry point, image base, section table, file size, and Large Address Aware flag remain unchanged.
The
.hookconversion preserves the same two target addresses and the same replacement instructions.Runtime evidence
The same two particle-pool capacity changes were included in later combined user-test executables used in long, effect-heavy FAF games, providing startup and long-session smoke coverage.
A controlled particle-saturation A/B capture has not yet been attached, so this PR makes no measured FPS or effect-count claim.
Regression test instructions
Build the executable from this branch.
Verify the output instructions:
0x004928ED:C7 44 24 10 00 10 00 00;0x004929B2:C7 44 24 10 90 01 00 00.Start and exit the game repeatedly to exercise pool construction and destruction.
Run a vanilla sandbox and verify normal weapons, explosions, smoke, build effects, reclaim effects, trails, beams, and decals.
Replay the same particle-heavy scenario on the current and patched builds.
Continue until the current build begins omitting visible effects, then compare the patched build at the same time and camera position.
Where instrumentation is available, record:
Test long sessions, save/load, observer mode, camera and LOD transitions, and effect-heavy SIM mods.
Verify safe pool exhaustion at the new fixed limits.
Compare shutdown behavior and confirm that resources are released normally.
Scope
400 -> 4096.100 -> 400.200.400.Files changed
Checklist
.hookformat following maintainer feedbackhooks/ParticlePoolCapacity.hook