profile atlas recreation

This commit is contained in:
veclavtalica
2025-01-15 06:04:02 +03:00
parent db530ca3a0
commit 4659cf2aef
2 changed files with 10 additions and 5 deletions

View File

@ -186,6 +186,8 @@ static void upload_texture_from_surface(GPUTexture texture, SDL_Surface *surface
static void recreate_current_atlas_texture(TextureCache *cache) {
profile_start("atlas recreation");
/* TODO: should surfaces be freed after they cannot be referenced in atlas builing? */
/* for example, if full page of 64x64 tiles was already filled, there's no real reason to process them further */
SDL_Surface *atlas_surface = cache->atlas_surfaces[cache->atlas_index];
@ -216,6 +218,8 @@ static void recreate_current_atlas_texture(TextureCache *cache) {
/* texturize it! */
upload_texture_from_surface(cache->atlas_textures[cache->atlas_index], atlas_surface);
profile_end("atlas recreation");
}