mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
gl: Only unbind buffers/vertex attrib arrays if we can't directly bind the vertex array to 0
Binding the vertex array to 0 will unbind everything else already. In the previous order older versions of the Intel GL driver caused errors to be printed for every single call when disabling the vertex attrib arrays after binding the vertex array to 0.
This commit is contained in:
parent
30b5d7892a
commit
acc098a736
12 changed files with 30 additions and 18 deletions
|
@ -1005,6 +1005,7 @@ gst_ca_opengl_layer_sink_on_draw (GstCAOpenGLLayerSink * ca_sink)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (ca_sink);
|
||||
|
||||
/* end default opengl scene */
|
||||
|
|
|
@ -222,6 +222,7 @@ _src_shader_fill_bound_fbo (gpointer impl)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (src);
|
||||
|
||||
gst_gl_context_clear_shader (src->base.context);
|
||||
|
|
|
@ -484,6 +484,7 @@ _callback (gpointer stuff)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (cube_filter);
|
||||
|
||||
gl->Disable (GL_DEPTH_TEST);
|
||||
|
|
|
@ -2299,6 +2299,7 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (gl_sink);
|
||||
|
||||
if (gl_sink->ignore_alpha)
|
||||
|
|
|
@ -545,6 +545,7 @@ gst_gl_overlay_callback (GstGLFilter * filter, GstGLMemory * in_tex,
|
|||
out:
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (overlay);
|
||||
|
||||
gst_gl_context_clear_shader (GST_GL_BASE_FILTER (filter)->context);
|
||||
|
|
|
@ -961,6 +961,7 @@ gst_gl_transformation_callback (gpointer stuff)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (transformation);
|
||||
|
||||
gst_gl_context_clear_shader (GST_GL_BASE_FILTER (filter)->context);
|
||||
|
|
|
@ -1613,15 +1613,16 @@ gst_gl_video_mixer_callback (gpointer stuff)
|
|||
video_mixer->output_geo_change = FALSE;
|
||||
GST_OBJECT_UNLOCK (video_mixer);
|
||||
|
||||
if (gl->GenVertexArrays) {
|
||||
gl->BindVertexArray (0);
|
||||
} else {
|
||||
gl->DisableVertexAttribArray (attr_position_loc);
|
||||
gl->DisableVertexAttribArray (attr_texture_loc);
|
||||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
|
||||
gl->BindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
||||
gl->BindTexture (GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
gl->Disable (GL_BLEND);
|
||||
|
||||
|
|
|
@ -2589,6 +2589,7 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert)
|
|||
|
||||
if (gl->BindVertexArray)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (convert);
|
||||
|
||||
if (gl->DrawBuffer)
|
||||
|
|
|
@ -1251,6 +1251,7 @@ gst_gl_filter_draw_fullscreen_quad (GstGLFilter * filter)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (filter);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1928,6 +1928,7 @@ _do_view_convert_draw (GstGLContext * context, GstGLViewConvert * viewconvert)
|
|||
|
||||
if (gl->BindVertexArray)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (viewconvert);
|
||||
if (gl->DrawBuffer)
|
||||
gl->DrawBuffer (GL_COLOR_ATTACHMENT0);
|
||||
|
|
|
@ -246,6 +246,7 @@ blit_tex (gpointer data)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (context);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -247,6 +247,7 @@ blit_tex (gpointer data)
|
|||
|
||||
if (gl->GenVertexArrays)
|
||||
gl->BindVertexArray (0);
|
||||
else
|
||||
_unbind_buffer (context);
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue