gl: fixup vao and vbo usage for legacy GL
This commit is contained in:
parent
1d324e259a
commit
f021549294
@ -468,6 +468,7 @@ _callback (gpointer stuff)
|
|||||||
|
|
||||||
if (gl->GenVertexArrays) {
|
if (gl->GenVertexArrays) {
|
||||||
_bind_buffer (cube_filter);
|
_bind_buffer (cube_filter);
|
||||||
|
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1215,8 +1215,12 @@ gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink)
|
|||||||
gl->GenBuffers (1, &gl_sink->vertex_buffer);
|
gl->GenBuffers (1, &gl_sink->vertex_buffer);
|
||||||
_bind_buffer (gl_sink);
|
_bind_buffer (gl_sink);
|
||||||
|
|
||||||
if (gl->GenVertexArrays)
|
if (gl->GenVertexArrays) {
|
||||||
gl->BindVertexArray (0);
|
gl->BindVertexArray (0);
|
||||||
|
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
||||||
|
} else {
|
||||||
|
_unbind_buffer (gl_sink);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1229,8 +1233,10 @@ gst_glimage_sink_cleanup_glthread (GstGLImageSink * gl_sink)
|
|||||||
gl_sink->redisplay_shader = NULL;
|
gl_sink->redisplay_shader = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gl_sink->vao)
|
if (gl_sink->vao) {
|
||||||
gl->DeleteVertexArrays (1, &gl_sink->vao);
|
gl->DeleteVertexArrays (1, &gl_sink->vao);
|
||||||
|
gl_sink->vao = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -532,6 +532,7 @@ gst_gl_overlay_callback (gint width, gint height, guint texture, gpointer stuff)
|
|||||||
if (overlay->geometry_change)
|
if (overlay->geometry_change)
|
||||||
_bind_buffer (overlay, overlay->overlay_vbo);
|
_bind_buffer (overlay, overlay->overlay_vbo);
|
||||||
gl->BindVertexArray (overlay->overlay_vao);
|
gl->BindVertexArray (overlay->overlay_vao);
|
||||||
|
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
||||||
} else {
|
} else {
|
||||||
_bind_buffer (overlay, overlay->overlay_vbo);
|
_bind_buffer (overlay, overlay->overlay_vbo);
|
||||||
}
|
}
|
||||||
|
@ -465,8 +465,6 @@ _upload_vertices (GstGLTransformation * transformation)
|
|||||||
|
|
||||||
gl->BufferData (GL_ARRAY_BUFFER, 4 * 6 * sizeof (GLfloat), vertices,
|
gl->BufferData (GL_ARRAY_BUFFER, 4 * 6 * sizeof (GLfloat), vertices,
|
||||||
GL_STATIC_DRAW);
|
GL_STATIC_DRAW);
|
||||||
|
|
||||||
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -546,12 +544,16 @@ gst_gl_transformation_callback (gpointer stuff)
|
|||||||
if (gl->GenVertexArrays)
|
if (gl->GenVertexArrays)
|
||||||
gl->BindVertexArray (transformation->vao);
|
gl->BindVertexArray (transformation->vao);
|
||||||
|
|
||||||
if (transformation->caps_change)
|
if (transformation->caps_change) {
|
||||||
_upload_vertices (transformation);
|
_upload_vertices (transformation);
|
||||||
|
|
||||||
if (!gl->GenVertexArrays || transformation->caps_change)
|
|
||||||
_bind_buffer (transformation);
|
_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);
|
gl->DrawElements (GL_TRIANGLE_STRIP, 5, GL_UNSIGNED_SHORT, indices);
|
||||||
|
|
||||||
if (gl->GenVertexArrays)
|
if (gl->GenVertexArrays)
|
||||||
|
@ -747,9 +747,8 @@ gst_gl_video_mixer_callback (gpointer stuff)
|
|||||||
|
|
||||||
if (gl->GenVertexArrays)
|
if (gl->GenVertexArrays)
|
||||||
gl->BindVertexArray (0);
|
gl->BindVertexArray (0);
|
||||||
else
|
|
||||||
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
|
||||||
|
|
||||||
|
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, 0);
|
gl->BindTexture (GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
gl->Disable (GL_BLEND);
|
gl->Disable (GL_BLEND);
|
||||||
|
@ -1596,6 +1596,7 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
|
|||||||
|
|
||||||
if (gl->GenVertexArrays) {
|
if (gl->GenVertexArrays) {
|
||||||
_bind_buffer (filter);
|
_bind_buffer (filter);
|
||||||
|
gl->BindBuffer (GL_ARRAY_BUFFER, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user