Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[core] Merge TexturePool into ObjectStore; pool all textures - #5477

Merged
jfirebaugh merged 1 commit into
masterfrom
pool-all-textures
Jun 27, 2016
Merged

jfirebaugh merged 1 commit into
masterfrom
pool-all-textures

Conversation

@jfirebaugh

Copy link
Copy Markdown
Contributor

cc @kkaefer @brunoabinader -- Any reason not to make this simplification?

@kkaefer

kkaefer commented Jun 25, 2016

Copy link
Copy Markdown
Member

👍

MBGL_CHECK_ERROR(glGenTextures(TextureMax, pooledTextures.data()));
}

GLuint id = pooledTextures.back();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this this will fail once the amount of textures in use reaches TextureMax + 1.

Previous texture pool logic uses a pool of pools, where a new texture pool would be generated when the current pool size reaches its limit - and old & unused pools would be eventually free'd.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If there are TextureMax textures in use, then pooledTextures will be empty() and the next createTexture() request will create TextureMax more textures.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it now 👍 Indeed, after re-reading this patch I guess we didn't need to keep track of previous generated pools as we did before.

@jfirebaugh
jfirebaugh merged commit 8956179 into master Jun 27, 2016
@jfirebaugh
jfirebaugh deleted the pool-all-textures branch June 27, 2016 20:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants