mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] egl: fix streaming texture re-init crash
This commit is contained in:
parent
84b2917706
commit
86f4256b5a
@ -189,19 +189,26 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_
|
|||||||
|
|
||||||
if (streaming)
|
if (streaming)
|
||||||
{
|
{
|
||||||
if (!texture->hasPBO)
|
if (texture->hasPBO)
|
||||||
{
|
{
|
||||||
glGenBuffers(2, texture->pbo);
|
// release old PBOs and delete the buffers
|
||||||
texture->hasPBO = true;
|
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)
|
for(int i = 0; i < 2; ++i)
|
||||||
{
|
{
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[i]);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[i]);
|
||||||
glBufferStorage(
|
glBufferStorage(
|
||||||
GL_PIXEL_UNPACK_BUFFER,
|
GL_PIXEL_UNPACK_BUFFER,
|
||||||
texture->pboBufferSize,
|
texture->pboBufferSize,
|
||||||
0,
|
NULL,
|
||||||
GL_MAP_PERSISTENT_BIT |
|
GL_MAP_PERSISTENT_BIT |
|
||||||
GL_MAP_WRITE_BIT |
|
GL_MAP_WRITE_BIT |
|
||||||
GL_MAP_COHERENT_BIT
|
GL_MAP_COHERENT_BIT
|
||||||
|
Loading…
Reference in New Issue
Block a user