libweston/renderer-gl/gl-renderer.c: use glDeleteTextures() and update gs->num_textures if num_textures is decrased

Signed-off-by: ahe <Andreas.Heynig@meetwise.com>
dev
ahe 5 years ago committed by Daniel Stone
parent 7803e83a94
commit c76cf48f3e
  1. 5
      libweston/renderer-gl/gl-renderer.c

@ -1866,8 +1866,11 @@ ensure_textures(struct gl_surface_state *gs, GLenum target, int num_textures)
{
int i;
if (num_textures <= gs->num_textures)
if (num_textures <= gs->num_textures) {
glDeleteTextures(gs->num_textures - num_textures, &gs->textures[num_textures]);
gs->num_textures = num_textures;
return;
}
glActiveTexture(GL_TEXTURE0);

Loading…
Cancel
Save