mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-26 15:27:19 +00:00
[egl] don't re-create the buffer each frame
This commit is contained in:
parent
0903b4a610
commit
1f1c9dfa59
@ -107,13 +107,12 @@ bool egl_texture_stream_buffer(EGL_Texture * texture, const uint8_t * buffer)
|
|||||||
if (++texture->pboIndex == 2)
|
if (++texture->pboIndex == 2)
|
||||||
texture->pboIndex = 0;
|
texture->pboIndex = 0;
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture->texture);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[texture->pboIndex]);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[texture->pboIndex]);
|
glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, texture->pboBufferSize, buffer);
|
||||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, texture->pboBufferSize, 0, GL_DYNAMIC_DRAW);
|
glBindTexture(GL_TEXTURE_2D, texture->texture);
|
||||||
glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, texture->pboBufferSize, buffer);
|
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, texture->width, texture->height, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, texture->width, texture->height, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user