diff --git a/ext/gl/gstglfiltercube.c b/ext/gl/gstglfiltercube.c index c7c704a90a..83895549d4 100644 --- a/ext/gl/gstglfiltercube.c +++ b/ext/gl/gstglfiltercube.c @@ -468,6 +468,7 @@ _callback (gpointer stuff) if (gl->GenVertexArrays) { _bind_buffer (cube_filter); + gl->BindBuffer (GL_ARRAY_BUFFER, 0); } } diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 4df435e8d5..240025c5af 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -1215,8 +1215,12 @@ gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink) gl->GenBuffers (1, &gl_sink->vertex_buffer); _bind_buffer (gl_sink); - if (gl->GenVertexArrays) + if (gl->GenVertexArrays) { gl->BindVertexArray (0); + gl->BindBuffer (GL_ARRAY_BUFFER, 0); + } else { + _unbind_buffer (gl_sink); + } } static void @@ -1229,8 +1233,10 @@ gst_glimage_sink_cleanup_glthread (GstGLImageSink * gl_sink) gl_sink->redisplay_shader = NULL; } - if (gl_sink->vao) + if (gl_sink->vao) { gl->DeleteVertexArrays (1, &gl_sink->vao); + gl_sink->vao = 0; + } } static void diff --git a/ext/gl/gstgloverlay.c b/ext/gl/gstgloverlay.c index 93bd9c1499..fb3f9fc312 100644 --- a/ext/gl/gstgloverlay.c +++ b/ext/gl/gstgloverlay.c @@ -532,6 +532,7 @@ gst_gl_overlay_callback (gint width, gint height, guint texture, gpointer stuff) if (overlay->geometry_change) _bind_buffer (overlay, overlay->overlay_vbo); gl->BindVertexArray (overlay->overlay_vao); + gl->BindBuffer (GL_ARRAY_BUFFER, 0); } else { _bind_buffer (overlay, overlay->overlay_vbo); } diff --git a/ext/gl/gstgltransformation.c b/ext/gl/gstgltransformation.c index ec097d0a13..6bc16b344f 100644 --- a/ext/gl/gstgltransformation.c +++ b/ext/gl/gstgltransformation.c @@ -465,8 +465,6 @@ _upload_vertices (GstGLTransformation * transformation) gl->BufferData (GL_ARRAY_BUFFER, 4 * 6 * sizeof (GLfloat), vertices, GL_STATIC_DRAW); - - gl->BindBuffer (GL_ARRAY_BUFFER, 0); } static void @@ -546,12 +544,16 @@ gst_gl_transformation_callback (gpointer stuff) if (gl->GenVertexArrays) gl->BindVertexArray (transformation->vao); - if (transformation->caps_change) + if (transformation->caps_change) { _upload_vertices (transformation); - - if (!gl->GenVertexArrays || transformation->caps_change) _bind_buffer (transformation); + if (gl->GenVertexArrays) + gl->BindBuffer (GL_ARRAY_BUFFER, 0); + } else if (!gl->GenVertexArrays) { + _bind_buffer (transformation); + } + gl->DrawElements (GL_TRIANGLE_STRIP, 5, GL_UNSIGNED_SHORT, indices); if (gl->GenVertexArrays) diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c index f16f6d325f..d673daee32 100644 --- a/ext/gl/gstglvideomixer.c +++ b/ext/gl/gstglvideomixer.c @@ -747,9 +747,8 @@ gst_gl_video_mixer_callback (gpointer stuff) if (gl->GenVertexArrays) gl->BindVertexArray (0); - else - gl->BindBuffer (GL_ARRAY_BUFFER, 0); + gl->BindBuffer (GL_ARRAY_BUFFER, 0); gl->BindTexture (GL_TEXTURE_2D, 0); gl->Disable (GL_BLEND); diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 9b126efaf7..9ca6456d6b 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -1596,6 +1596,7 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture, if (gl->GenVertexArrays) { _bind_buffer (filter); + gl->BindBuffer (GL_ARRAY_BUFFER, 0); } }