fosphor/gl: Use glTexSubImage2D for texture update
Much faster than glTexImage2D since it only updates the data and doesn't delete/create a new storage space for the data. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
1169b7efec
commit
64cf8a305b
|
@ -90,10 +90,9 @@ gl_tex2d_write(GLuint tex_id, float *src, int width, int height)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, tex_id);
|
glBindTexture(GL_TEXTURE_2D, tex_id);
|
||||||
|
|
||||||
glTexImage2D(
|
glTexSubImage2D(
|
||||||
GL_TEXTURE_2D,
|
GL_TEXTURE_2D, 0,
|
||||||
0, GL_R32F,
|
0, 0, width, height,
|
||||||
width, height, 0,
|
|
||||||
GL_RED, GL_FLOAT,
|
GL_RED, GL_FLOAT,
|
||||||
src
|
src
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue