mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 13:07:54 +00:00
[client] egl: fix streaming texture re-init crash
This commit is contained in:
parent
84b2917706
commit
86f4256b5a
2 changed files with 12 additions and 5 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
a12-206-gfc66a4a19c+1
|
||||
a12-207-g84b2917706+1
|
|
@ -189,19 +189,26 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_
|
|||
|
||||
if (streaming)
|
||||
{
|
||||
if (!texture->hasPBO)
|
||||
if (texture->hasPBO)
|
||||
{
|
||||
glGenBuffers(2, texture->pbo);
|
||||
texture->hasPBO = true;
|
||||
// release old PBOs and delete the buffers
|
||||
for(int i = 0; i < 2; ++i)
|
||||
{
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[i]);
|
||||
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||
}
|
||||
glDeleteBuffers(2, texture->pbo);
|
||||
}
|
||||
|
||||
glGenBuffers(2, texture->pbo);
|
||||
texture->hasPBO = true;
|
||||
for(int i = 0; i < 2; ++i)
|
||||
{
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[i]);
|
||||
glBufferStorage(
|
||||
GL_PIXEL_UNPACK_BUFFER,
|
||||
texture->pboBufferSize,
|
||||
0,
|
||||
NULL,
|
||||
GL_MAP_PERSISTENT_BIT |
|
||||
GL_MAP_WRITE_BIT |
|
||||
GL_MAP_COHERENT_BIT
|
||||
|
|
Loading…
Reference in a new issue