Hey folks
I have been doing some very basic gpu memory usage tests with sfml.
I'm having trouble making sense of some things:
I run my test program with no textures loaded. The gpu uses 333 mb of memory.
I dynamically create a drawable class with a 4k texture. The gpu now uses 397 mbs.
I destroy the class. Still 397.
I create another one (4k tex vertexarray class), the gpu now uses 454.
After this point, no matter how many times I create and destroy the drawables (doesn't matter how many different textures I use) the gpu memory is always at 454.
Is this behaviour normal? Can I not get that memory back?
snippets from the test code:
Show* ptrShow = nullptr; // Show class is sf::Drawable with a VertexArray
if (event.key.code == sf::Keyboard::C) // C is for construct
{
Show* s = new Show{ 1, "red.png" }; // Test 4k texture (one of multiple)
ptrShow = s;
}
if (event.key.code == sf::Keyboard::D) // D is for destruct
{
ptrShow->~Show();
ptrShow = nullptr;
}
if (ptrShow) { window.draw(*ptrShow); }