Skip to content

perf(gl): improved state tracking and other optimisations#330

Draft
cobaltgit wants to merge 15 commits into
ButterscotchRunner:mainfrom
cobaltgit:gl-optim
Draft

perf(gl): improved state tracking and other optimisations#330
cobaltgit wants to merge 15 commits into
ButterscotchRunner:mainfrom
cobaltgit:gl-optim

Conversation

@cobaltgit

Copy link
Copy Markdown
Collaborator

Todo: apply to legacy-gl and test

@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Slight but free performance boost here

@cobaltgit

cobaltgit commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

There's a lot more glEnable calls in legacy-gl, could maybe do a bitmask instead of however many booleans

EDIT: No point, it's not a hot struct and you'd only be saving 3 bytes and having to map the capabilities from GL to the bitmask.

@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Not enough meaningful improvement yet

@cobaltgit cobaltgit closed this Jul 20, 2026
@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Will look back into this later

@cobaltgit cobaltgit reopened this Jul 20, 2026
saves 5 gazillion strcmp calls every time a shader is set
@cobaltgit

cobaltgit commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Ch5 Hometown performance, should be a similar minor increase on paper in scenes with active shaders

Before After
image image

@cobaltgit cobaltgit closed this Jul 20, 2026
@cobaltgit cobaltgit changed the title perf(gl): improved state tracking perf(gl): improved state tracking and other optimisations Jul 21, 2026
@cobaltgit cobaltgit reopened this Jul 21, 2026
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.

1 participant