filter->fbo = 0;
filter->depthbuffer = 0;
filter->default_shader = NULL;
+ filter->draw_attr_position_loc = -1;
+ filter->draw_attr_texture_loc = -1;
if (filter->other_context)
gst_object_unref (filter->other_context);
filter->other_context = NULL;
if (!filter->default_shader)
return;
- if (!filter->draw_attr_position_loc)
+ if (filter->draw_attr_position_loc == -1)
filter->draw_attr_position_loc =
gst_gl_shader_get_attribute_location (filter->default_shader,
"a_position");
- if (!filter->draw_attr_texture_loc)
+ if (filter->draw_attr_texture_loc == -1)
filter->draw_attr_texture_loc =
gst_gl_shader_get_attribute_location (filter->default_shader,
"a_texcoord");
gl->BindBuffer (GL_ARRAY_BUFFER, filter->vertex_buffer);
+ _get_attributes (filter);
/* Load the vertex position */
gl->VertexAttribPointer (filter->draw_attr_position_loc, 3, GL_FLOAT,
GL_FALSE, 5 * sizeof (GLfloat), (void *) 0);
gl->VertexAttribPointer (filter->draw_attr_texture_loc, 2, GL_FLOAT, GL_FALSE,
5 * sizeof (GLfloat), (void *) (3 * sizeof (GLfloat)));
- _get_attributes (filter);
gl->EnableVertexAttribArray (filter->draw_attr_position_loc);
gl->EnableVertexAttribArray (filter->draw_attr_texture_loc);