mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
metal: fix texture memory tracking
This commit is contained in:
@@ -237,23 +237,6 @@ bool Texture::loadVolatile()
|
||||
}
|
||||
}
|
||||
|
||||
int64 memsize = 0;
|
||||
|
||||
if (root)
|
||||
{
|
||||
for (int mip = 0; mip < getMipmapCount(); mip++)
|
||||
{
|
||||
int w = getPixelWidth(mip);
|
||||
int h = getPixelHeight(mip);
|
||||
int slices = getDepth(mip) * layerCount;
|
||||
memsize += getPixelFormatSliceSize(format, w, h) * slices;
|
||||
}
|
||||
|
||||
memsize *= static_cast<int>(msaaSamples);
|
||||
}
|
||||
|
||||
setGraphicsMemorySize(memsize);
|
||||
|
||||
if (!debugName.empty())
|
||||
{
|
||||
if (vgfx->getEnabledOptionalInstanceExtensions().debugInfo)
|
||||
@@ -275,6 +258,8 @@ bool Texture::loadVolatile()
|
||||
}
|
||||
}
|
||||
|
||||
updateGraphicsMemorySize(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -301,7 +286,7 @@ void Texture::unloadVolatile()
|
||||
textureImage = VK_NULL_HANDLE;
|
||||
textureImageAllocation = VK_NULL_HANDLE;
|
||||
|
||||
setGraphicsMemorySize(0);
|
||||
updateGraphicsMemorySize(false);
|
||||
}
|
||||
|
||||
Texture::~Texture()
|
||||
|
||||
Reference in New Issue
Block a user