aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2015-01-19 00:52:42 +0100
committerSylvain Munaut <tnt@246tNt.com>2015-01-19 14:16:25 +0100
commit64cf8a305b6a89a790d6c687c28cc959eb18d3bf (patch)
treec3de03764f39d58d3f277654944df68772336abe
parent1169b7efece549879e5a4cfae2df24cb72949e4a (diff)
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>
-rw-r--r--lib/fosphor/gl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/fosphor/gl.c b/lib/fosphor/gl.c
index ec53277..48acc40 100644
--- a/lib/fosphor/gl.c
+++ b/lib/fosphor/gl.c
@@ -90,10 +90,9 @@ gl_tex2d_write(GLuint tex_id, float *src, int width, int height)
{
glBindTexture(GL_TEXTURE_2D, tex_id);
- glTexImage2D(
- GL_TEXTURE_2D,
- 0, GL_R32F,
- width, height, 0,
+ glTexSubImage2D(
+ GL_TEXTURE_2D, 0,
+ 0, 0, width, height,
GL_RED, GL_FLOAT,
src
);