diff --git a/src/modules/graphics/vulkan/Texture.cpp b/src/modules/graphics/vulkan/Texture.cpp index 1d28b62a0..74e21829a 100644 --- a/src/modules/graphics/vulkan/Texture.cpp +++ b/src/modules/graphics/vulkan/Texture.cpp @@ -187,6 +187,20 @@ bool Texture::loadVolatile() } } + int64 memsize = 0; + + 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(msaaSamples); + + setGraphicsMemorySize(memsize); + return true; } @@ -210,6 +224,8 @@ void Texture::unloadVolatile() }); textureImage = VK_NULL_HANDLE; + + setGraphicsMemorySize(0); } Texture::~Texture()