Skip to content

Commit

Permalink
vulkan: don't hold onto ImageData references after loading an image.
Browse files Browse the repository at this point in the history
Reduces CPU memory usage.
  • Loading branch information
slime73 committed Oct 9, 2023
1 parent 90cd0be commit 86eb6df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/graphics/vulkan/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Texture::Texture(love::graphics::Graphics *gfx, const Settings &settings, const
slices = *data;

loadVolatile();

// ImageData is referenced by the first loadVolatile call, but we don't
// hang on to it after that so we can save memory.
slices.clear();
}

bool Texture::loadVolatile()
Expand Down

0 comments on commit 86eb6df

Please sign in to comment.