Skip to content

add caching to GlStateManager#glViewport#3309

Merged
douira merged 2 commits intoCaffeineMC:devfrom
crosby-moe:gl-viewport-caching
Apr 30, 2026
Merged

add caching to GlStateManager#glViewport#3309
douira merged 2 commits intoCaffeineMC:devfrom
crosby-moe:gl-viewport-caching

Conversation

@crosby-moe
Copy link
Copy Markdown
Contributor

Every RenderPass object created caused a non-memoized call to GL11#glViewport, usually with the same arguments

Summing up all instances of GlStateManager#glViewport in a spark profile from a simple world with an uncapped framerate:
Before: 214.6ms in 60s, or .35% of render thread [spark profile]
After: 3.2ms in 60s [spark profile]

Copy link
Copy Markdown
Contributor

@douira douira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR seems ok to me in general, though I don't know anything about the code we're mixing into here. I've just requested two small syntactic changes.

Comment thread common/src/main/resources/sodium-common.mixins.json
@Lolothepro
Copy link
Copy Markdown
Contributor

Any updates?

@douira
Copy link
Copy Markdown
Contributor

douira commented Apr 30, 2026

The author did not address to our concerns yet.

@douira douira force-pushed the gl-viewport-caching branch from f3a6a73 to 8f9a553 Compare April 30, 2026 15:29
@douira
Copy link
Copy Markdown
Contributor

douira commented Apr 30, 2026

I've resolved the concerns myself.

@douira douira merged commit 111bedb into CaffeineMC:dev Apr 30, 2026
douira added a commit that referenced this pull request Apr 30, 2026
---------

Co-authored-by: RacoonDog <32882447+racoondog@users.noreply.github.com>
Co-authored-by: douira <douira100@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants