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

Issue 6024: Minimize number of render objects preallocated for the sprite component #6025

Merged
merged 1 commit into from Sep 3, 2021

Conversation

JCash
Copy link
Contributor

@JCash JCash commented Sep 2, 2021

No description provided.

@JCash JCash requested a review from britzl September 2, 2021 14:04
// Although we generally like to preallocate it, we cannot since we
// 1) don't want to preallocate max_sprite number of render objects and
// 2) We cannot keep the render object in a (small) fixed array and then reallocate it, since we pass the pointer to the render engine
if (sprite_world->m_RenderObjectsInUse == sprite_world->m_RenderObjects.Capacity())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We just let it grow dynamically, so that we allocate a minimum amount of objects.

@JCash JCash linked an issue Sep 2, 2021 that may be closed by this pull request
Copy link
Contributor

@britzl britzl left a comment

Choose a reason for hiding this comment

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

Looks good!

@JCash JCash merged commit a616ef4 into dev Sep 3, 2021
JCash added a commit that referenced this pull request Sep 3, 2021
@JCash JCash deleted the issue-6024-sprite-comp-renderobjects-opt branch September 3, 2021 07:09
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.

Minimize number of preallocated render objects for the sprite component
2 participants