aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-01-28 01:21:48 +0100
committerdec05eba <dec05eba@protonmail.com>2024-01-28 01:21:48 +0100
commit64b0f3b7fa136d5cd9dd9d9d9f334a56ec6c2b19 (patch)
tree5b221b66d11a503074e09218c931c0f34e6a0c56
parent846bda7510984209cd9284981fa408d4ddb74c22 (diff)
Remove one extra gl texture bind
-rw-r--r--src/color_conversion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/color_conversion.c b/src/color_conversion.c
index d6cd6ad..ebf802b 100644
--- a/src/color_conversion.c
+++ b/src/color_conversion.c
@@ -317,12 +317,13 @@ int gsr_color_conversion_draw(gsr_color_conversion *self, unsigned int texture_i
const int texture_target = external_texture ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D;
+ self->params.egl->glBindTexture(texture_target, texture_id);
+
vec2i source_texture_size = {0, 0};
if(external_texture) {
source_texture_size = source_size;
} else {
/* TODO: Do not call this every frame? */
- self->params.egl->glBindTexture(texture_target, texture_id);
self->params.egl->glGetTexLevelParameteriv(texture_target, 0, GL_TEXTURE_WIDTH, &source_texture_size.x);
self->params.egl->glGetTexLevelParameteriv(texture_target, 0, GL_TEXTURE_HEIGHT, &source_texture_size.y);
}
@@ -365,7 +366,6 @@ int gsr_color_conversion_draw(gsr_color_conversion *self, unsigned int texture_i
self->params.egl->glBindVertexArray(self->vertex_array_object_id);
self->params.egl->glViewport(0, 0, dest_texture_size.x, dest_texture_size.y);
- self->params.egl->glBindTexture(texture_target, texture_id);
/* TODO: this, also cleanup */
//self->params.egl->glBindBuffer(GL_ARRAY_BUFFER, self->vertex_buffer_object_id);