Repository navigation
Borrow one int array for all alpha model sorted faces - #1171
Closed
RuffledPlume wants to merge 37 commits into
Closed
RuffledPlume wants to merge 37 commits into
RuffledPlume wants to merge 37 commits into
Conversation
Instead of borrowing an Int array for each AlphaModel which needs sorting, we calculate the total sorted faces then borrow a Int array for the whole zone. Each AlphaModel now has a offset into the Zone Array EboAlphaWriterJob finds continuous ranges before flushing the indicies to the eboBuffer
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
August 14, 2026 13:04
f168c99 to
e6d70ca
Compare
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
August 14, 2026 22:57
f0c5e90 to
345b23c
Compare
RuffledPlume
marked this pull request as draft
August 17, 2026 09:42
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
August 17, 2026 12:09
524da49 to
713ccc2
Compare
RuffledPlume
marked this pull request as ready for review
August 17, 2026 12:09
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
August 17, 2026 12:34
713ccc2 to
b6a7304
Compare
Added EboAlpha Upload Timer Tweaks Fix MultiLocs Calculate AlphaModel Distance once QuickSort Accessor Implementation Added Keyed List QuickSort Combine Accessors into a single class JIT was struggling to optimise the internal Quick Sort function resulting in VTable invocations which was hampering the sorting perf Tweaks
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
August 17, 2026 12:37
b6a7304 to
2a69243
Compare
If there is only two AlphaModels we can avoid the Key QuickSort by just comparing the distances
aHooder
reviewed
Aug 27, 2026
aHooder
left a comment
Member
There was a problem hiding this comment.
This helps a lot with performance north or Prifddinas 🙂
I still need to review this more thoroughly, but at first glance I just have one question.
Mark7625
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
October 11, 2026 21:13
f7f5c14 to
5bdc09e
Compare
Mark7625
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
October 11, 2026 21:28
5eda2bd to
de69b72
Compare
* Combine `drawOff` & `drawEnd` into a single array * Remove the `copyTo` instead write the offset & length directly * calculate the vertSizeInts once outside of the loop
Alpha Shadows are drawn on first call to `drawZoneAlpha` instead of per level, improve shadow GPU performance & reducing draw calls Also fixed bug where `bufLen` & `bufLenA` was incorrect
Contributor
Author
Checks if the Bounds of all AlphaModels combined straddle the Frustum, meaning that there is a chance a AlphaModel might not be visible before checking per alpha model visibility
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
October 12, 2026 05:31
2a22611 to
ba90764
Compare
Also Always trigger sorting job, visibility will be determined within the job which avoid stale visibility due to the setup using the previous frames visibility
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
3 times, most recently
from
October 12, 2026 08:22
e1da095 to
b745c0d
Compare
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
October 12, 2026 08:22
b745c0d to
d503db0
Compare
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
October 12, 2026 12:55
7b1cc7d to
262b429
Compare
This version implements a Per-type accessor interface over the shared Kind version which allows for better JIT Optimisation
RuffledPlume
force-pushed
the
StaticAlphaModelTempFaceOptimization
branch
from
October 13, 2026 11:05
fa9192c to
9619062
Compare
Contributor
Author
|
Closing in Favor of #1179 since it would make all of these optimizations redundant and offloads the Alpha cost fully onto the GPU |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Instead of borrowing an Int array for each AlphaModel which needs sorting, we calculate the total sorted faces then borrow a Int array for the whole zone.
Each AlphaModel now has a offset into the Zone Array
EboAlphaWriterJob finds continuous ranges before flushing the indicies to the eboBuffer
Before:

After (3x improvement):

Before:

After (1.6x improvement):
