Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize ProgramState::setTexture() to avoid vector (de)allocations #2061

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

smilediver
Copy link
Contributor

ProgramState::setTexture() on each call creates new TextureInfo, which allocates new vectors, and then assigns it to another TextureInfo freeing old vectors and moving the new ones. This optimization removes these redundant (de)allocations by setting the values directly and reusing the old vectors if possible.

@halx99 halx99 merged commit fed5f8a into axmolengine:dev Jul 30, 2024
15 checks passed
@smilediver smilediver deleted the optimize_programstate branch July 30, 2024 19:15
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