[client] egl: eliminate GLsync object leaks

It used to be the case that we overwrite this->sync even if it was non-zero
when updating the texture, without deleting the sync object. If we update
faster than we render, the result would be leaking sync objects.

This commit ensures that sync objects are deleted when they are replaced.
This commit is contained in:
Quantum
2021-08-07 19:04:49 -04:00
committed by Geoffrey McRae
parent 16f68d6b1b
commit b3db1ba10b
2 changed files with 18 additions and 17 deletions

View File

@@ -31,16 +31,16 @@ typedef struct TextureBuffer
EGL_Texture base;
bool free;
EGL_TexFormat format;
int texCount;
GLuint tex[EGL_TEX_BUFFER_MAX];
GLuint sampler;
EGL_TexBuffer buf[EGL_TEX_BUFFER_MAX];
int bufFree;
GLsync sync;
LG_Lock copyLock;
int bufIndex;
int rIndex;
EGL_TexFormat format;
int texCount;
GLuint tex[EGL_TEX_BUFFER_MAX];
GLuint sampler;
EGL_TexBuffer buf[EGL_TEX_BUFFER_MAX];
int bufFree;
_Atomic(GLsync) sync;
LG_Lock copyLock;
int bufIndex;
int rIndex;
}
TextureBuffer;