aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-03-20 13:19:14 +0100
committerGuido Günther <agx@sigxcpu.org>2018-03-20 14:30:30 +0100
commit13e4ba4867c0b5ab2193728d6a4192007fe8276b (patch)
tree4f0039891f94b3baae9c07b78772ea28506da00e /render
parentb3cb5a36c7230070419afc71704800b380549a04 (diff)
gles2_texture_bind: use texture's target type
Hardcoding GL_TEXTURE_2D leads to rendering errors when using GL_TEXTURE_EXTERNAL_OES textures.
Diffstat (limited to 'render')
-rw-r--r--render/gles2/texture.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index b3035826..99f153b8 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -306,9 +306,10 @@ static void gles2_texture_get_buffer_size(struct wlr_texture *texture, struct
static void gles2_texture_bind(struct wlr_texture *_texture) {
struct wlr_gles2_texture *texture = (struct wlr_gles2_texture *)_texture;
- GL_CALL(glBindTexture(GL_TEXTURE_2D, texture->tex_id));
- GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
- GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
+
+ GL_CALL(glBindTexture(texture->target, texture->tex_id));
+ GL_CALL(glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
+ GL_CALL(glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
GL_CALL(glUseProgram(*texture->pixel_format->shader));
}