mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
glfilter: fix position/texcoord attrib index usage
https://bugzilla.gnome.org/show_bug.cgi?id=741231
This commit is contained in:
parent
f8611d79d7
commit
fc09b8b93c
1 changed files with 5 additions and 3 deletions
|
@ -299,6 +299,8 @@ gst_gl_filter_reset (GstGLFilter * filter)
|
||||||
filter->fbo = 0;
|
filter->fbo = 0;
|
||||||
filter->depthbuffer = 0;
|
filter->depthbuffer = 0;
|
||||||
filter->default_shader = NULL;
|
filter->default_shader = NULL;
|
||||||
|
filter->draw_attr_position_loc = -1;
|
||||||
|
filter->draw_attr_texture_loc = -1;
|
||||||
if (filter->other_context)
|
if (filter->other_context)
|
||||||
gst_object_unref (filter->other_context);
|
gst_object_unref (filter->other_context);
|
||||||
filter->other_context = NULL;
|
filter->other_context = NULL;
|
||||||
|
@ -1450,12 +1452,12 @@ _get_attributes (GstGLFilter * filter)
|
||||||
if (!filter->default_shader)
|
if (!filter->default_shader)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!filter->draw_attr_position_loc)
|
if (filter->draw_attr_position_loc == -1)
|
||||||
filter->draw_attr_position_loc =
|
filter->draw_attr_position_loc =
|
||||||
gst_gl_shader_get_attribute_location (filter->default_shader,
|
gst_gl_shader_get_attribute_location (filter->default_shader,
|
||||||
"a_position");
|
"a_position");
|
||||||
|
|
||||||
if (!filter->draw_attr_texture_loc)
|
if (filter->draw_attr_texture_loc == -1)
|
||||||
filter->draw_attr_texture_loc =
|
filter->draw_attr_texture_loc =
|
||||||
gst_gl_shader_get_attribute_location (filter->default_shader,
|
gst_gl_shader_get_attribute_location (filter->default_shader,
|
||||||
"a_texcoord");
|
"a_texcoord");
|
||||||
|
@ -1504,6 +1506,7 @@ _bind_buffer (GstGLFilter * filter)
|
||||||
|
|
||||||
gl->BindBuffer (GL_ARRAY_BUFFER, filter->vertex_buffer);
|
gl->BindBuffer (GL_ARRAY_BUFFER, filter->vertex_buffer);
|
||||||
|
|
||||||
|
_get_attributes (filter);
|
||||||
/* Load the vertex position */
|
/* Load the vertex position */
|
||||||
gl->VertexAttribPointer (filter->draw_attr_position_loc, 3, GL_FLOAT,
|
gl->VertexAttribPointer (filter->draw_attr_position_loc, 3, GL_FLOAT,
|
||||||
GL_FALSE, 5 * sizeof (GLfloat), (void *) 0);
|
GL_FALSE, 5 * sizeof (GLfloat), (void *) 0);
|
||||||
|
@ -1512,7 +1515,6 @@ _bind_buffer (GstGLFilter * filter)
|
||||||
gl->VertexAttribPointer (filter->draw_attr_texture_loc, 2, GL_FLOAT, GL_FALSE,
|
gl->VertexAttribPointer (filter->draw_attr_texture_loc, 2, GL_FLOAT, GL_FALSE,
|
||||||
5 * sizeof (GLfloat), (void *) (3 * sizeof (GLfloat)));
|
5 * sizeof (GLfloat), (void *) (3 * sizeof (GLfloat)));
|
||||||
|
|
||||||
_get_attributes (filter);
|
|
||||||
|
|
||||||
gl->EnableVertexAttribArray (filter->draw_attr_position_loc);
|
gl->EnableVertexAttribArray (filter->draw_attr_position_loc);
|
||||||
gl->EnableVertexAttribArray (filter->draw_attr_texture_loc);
|
gl->EnableVertexAttribArray (filter->draw_attr_texture_loc);
|
||||||
|
|
Loading…
Reference in a new issue