Skip to content

add caching to GlStateManager#glViewport#3309

Open
crosby-moe wants to merge 1 commit intoCaffeineMC:devfrom
crosby-moe:gl-viewport-caching
Open

add caching to GlStateManager#glViewport#3309
crosby-moe wants to merge 1 commit intoCaffeineMC:devfrom
crosby-moe:gl-viewport-caching

Conversation

@crosby-moe
Copy link

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
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 on lines +11 to +14
@Unique private static int viewportX;
@Unique private static int viewportY;
@Unique private static int viewportWidth;
@Unique private static int viewportHeight;
Copy link
Contributor

Choose a reason for hiding this comment

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

our code style is to put the annotation on its own line.

"features.render.model.ItemBlockRenderTypesMixin",
"features.render.model.item.ItemRendererMixin",
"features.render.particle.SingleQuadParticleMixin",
"features.render.viewport.GlStateManagerMixin",
Copy link
Contributor

Choose a reason for hiding this comment

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

this will need conflict resolution since it seems

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.

2 participants