fix bug in deallocate tex

This commit is contained in:
h4570
2022-07-28 11:51:16 +02:00
parent 59077bcfe9
commit 960f4dd0c4
2 changed files with 5 additions and 2 deletions
@@ -36,7 +36,7 @@ class RendererCoreGS {
constexpr static float gsCenter = 4096.0F; constexpr static float gsCenter = 4096.0F;
constexpr static float screenCenter = gsCenter / 2.0F; constexpr static float screenCenter = gsCenter / 2.0F;
constexpr static float vramMargin = constexpr static float vramMargin =
0.01F; // We don't have perfectly 4MB of VRAM 0.003F; // We don't have perfectly 4MB of VRAM
float spaceOccupiedByFrameBuffers, spaceOccupiedByZBuffer; float spaceOccupiedByFrameBuffers, spaceOccupiedByZBuffer;
RendererSettings* settings; RendererSettings* settings;
@@ -52,9 +52,12 @@ void RendererCoreTextureSender::deallocate(
} }
graph_vram_free(texBuffers.core->address); graph_vram_free(texBuffers.core->address);
float deallocateSize = getSizeInMB(texBuffers.core);
delete texBuffers.core; delete texBuffers.core;
allocatedVRamMemForTextures -= getSizeInMB(texBuffers.core); allocatedVRamMemForTextures -= deallocateSize;
} }
texbuffer_t* RendererCoreTextureSender::allocateTextureCore( texbuffer_t* RendererCoreTextureSender::allocateTextureCore(