mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
TINYGL: Changed the way tinyGL textures are disposed.
This commit is contained in:
parent
f0de01af01
commit
2b3fd8501a
@ -54,6 +54,7 @@ GLTexture *alloc_texture(GLContext *c, int h) {
|
||||
*ht = t;
|
||||
|
||||
t->handle = h;
|
||||
t->disposed = false;
|
||||
|
||||
return t;
|
||||
}
|
||||
@ -258,7 +259,8 @@ void tglDeleteTextures(int n, const unsigned int *textures) {
|
||||
if (t == c->current_texture) {
|
||||
tglBindTexture(TGL_TEXTURE_2D, 0);
|
||||
}
|
||||
TinyGL::free_texture(c, textures[i]);
|
||||
t->disposed = true;
|
||||
//TinyGL::free_texture(c, textures[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -138,6 +138,7 @@ struct GLTexture {
|
||||
GLImage images[MAX_TEXTURE_LEVELS];
|
||||
int handle;
|
||||
struct GLTexture *next, *prev;
|
||||
bool disposed;
|
||||
};
|
||||
|
||||
|
||||
|
@ -10,6 +10,15 @@ void tglPresentBuffer() {
|
||||
}
|
||||
c->drawCallsQueue.clear();
|
||||
|
||||
TinyGL::GLTexture *t = c->shared_state.texture_hash_table[0];
|
||||
while (t) {
|
||||
int handle = t->handle;
|
||||
if (t->disposed) {
|
||||
TinyGL::free_texture(c, handle);
|
||||
}
|
||||
t = t->next;
|
||||
}
|
||||
|
||||
Graphics::Internal::tglCleanupImages();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user