fix textures alloc problem
This commit is contained in:
@@ -36,7 +36,7 @@ class RendererCoreGS {
|
||||
constexpr static float gsCenter = 4096.0F;
|
||||
constexpr static float screenCenter = gsCenter / 2.0F;
|
||||
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;
|
||||
RendererSettings* settings;
|
||||
|
||||
@@ -31,7 +31,7 @@ RendererCoreTextureBuffers RendererCoreTextureSender::allocate(
|
||||
texbuffer_t* clut = nullptr;
|
||||
|
||||
auto texClut = t_texture->getClutData();
|
||||
if (texClut != nullptr && texClut->width + texClut->height > 0) {
|
||||
if (texClut != nullptr && texClut->width > 0) {
|
||||
clut = allocateTextureClut(t_texture);
|
||||
}
|
||||
return {t_texture->getId(), core, clut};
|
||||
@@ -46,14 +46,14 @@ float RendererCoreTextureSender::getSizeInMB(texbuffer_t* texBuffer) {
|
||||
|
||||
void RendererCoreTextureSender::deallocate(
|
||||
const RendererCoreTextureBuffers& texBuffers) {
|
||||
graph_vram_free(texBuffers.core->address);
|
||||
delete texBuffers.core;
|
||||
|
||||
if (texBuffers.clut != nullptr && texBuffers.clut->width > 0) {
|
||||
graph_vram_free(texBuffers.clut->address);
|
||||
delete texBuffers.clut;
|
||||
}
|
||||
|
||||
graph_vram_free(texBuffers.core->address);
|
||||
delete texBuffers.core;
|
||||
|
||||
allocatedVRamMemForTextures -= getSizeInMB(texBuffers.core);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user