mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 10:44:01 +00:00
[client] egl: there should only ever be a single sync object
This commit is contained in:
@@ -40,6 +40,12 @@ static void eglTexBuffer_cleanup(TextureBuffer * this)
|
||||
|
||||
if (this->sampler)
|
||||
glDeleteSamplers(1, &this->sampler);
|
||||
|
||||
if (this->sync)
|
||||
{
|
||||
glDeleteSync(this->sync);
|
||||
this->sync = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// common functions
|
||||
@@ -186,7 +192,7 @@ EGL_TexStatus eglTexBuffer_stream_process(EGL_Texture * texture_)
|
||||
GLuint tex = this->tex[this->bufIndex];
|
||||
EGL_TexBuffer * buffer = &this->buf[this->bufIndex];
|
||||
|
||||
if (buffer->updated && buffer->sync == 0)
|
||||
if (buffer->updated && this->sync == 0)
|
||||
{
|
||||
this->rIndex = this->bufIndex;
|
||||
if (++this->bufIndex == this->texCount)
|
||||
@@ -212,7 +218,7 @@ EGL_TexStatus eglTexBuffer_stream_process(EGL_Texture * texture_)
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
|
||||
buffer->sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
this->sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
glFlush();
|
||||
}
|
||||
|
||||
@@ -226,15 +232,14 @@ EGL_TexStatus eglTexBuffer_stream_bind(EGL_Texture * texture_)
|
||||
if (this->rIndex == -1)
|
||||
return EGL_TEX_STATUS_NOTREADY;
|
||||
|
||||
EGL_TexBuffer * buffer = &this->buf[this->rIndex];
|
||||
if (buffer->sync)
|
||||
if (this->sync)
|
||||
{
|
||||
switch(glClientWaitSync(buffer->sync, 0, 20000000)) // 20ms
|
||||
switch(glClientWaitSync(this->sync, 0, 20000000)) // 20ms
|
||||
{
|
||||
case GL_ALREADY_SIGNALED:
|
||||
case GL_CONDITION_SATISFIED:
|
||||
glDeleteSync(buffer->sync);
|
||||
buffer->sync = 0;
|
||||
glDeleteSync(this->sync);
|
||||
this->sync = 0;
|
||||
break;
|
||||
|
||||
case GL_TIMEOUT_EXPIRED:
|
||||
@@ -242,8 +247,8 @@ EGL_TexStatus eglTexBuffer_stream_bind(EGL_Texture * texture_)
|
||||
|
||||
case GL_WAIT_FAILED:
|
||||
case GL_INVALID_VALUE:
|
||||
glDeleteSync(buffer->sync);
|
||||
buffer->sync = 0;
|
||||
glDeleteSync(this->sync);
|
||||
this->sync = 0;
|
||||
DEBUG_GL_ERROR("glClientWaitSync failed");
|
||||
return EGL_TEX_STATUS_ERROR;
|
||||
}
|
||||
|
Reference in New Issue
Block a user