Repository navigation
Build each rendering phase's GL debug group name once, not on every setPhase - #871
Open
BonsUnleashed wants to merge 1 commit into
Open
BonsUnleashed wants to merge 1 commit into
BonsUnleashed wants to merge 1 commit into
Conversation
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.
IrisRenderingPipeline.setPhasebuilds the GL debug group name on every call:StringUtils.capitalizeof the lower-cased phase name with the underscores replaced. The phase changes each time an entity or block entity render type is drawn, and for particles, terrain layers and the sky, so in a busy scene the same few strings were rebuilt and discarded hundreds of times per frame, whether or not GL debug output was on.Now each
WorldRenderingPhaseconstant builds its name once, with the same expression, andsetPhasereads it throughgetDebugName(). All 24 names equal what the old expression returns, and the pop, the push withphase.ordinal()and thephasefield write stay in the same order. The two importssetPhaseno longer needs are removed. It does not touch the files of #869 or #870.The same change ships as a patch for Oculus 1.8.0 in Bons and Furious (since 1.0.21); timed outside the game with the real
WorldRenderingPhase, the name went from about 32 ns to about 1.4 ns per phase change, andsetPhasewas 0.14% and 0.06% of the render thread in two profiles of a large Forge pack, nearly all of it this expression.Compiles on
1.20.1-new(compileJava compileSodiumCompatibilityJava). Not tested in game on this branch.