Example #1
0
/**
 * gst_gl_shader_bind_frag_data_location:
 * @shader: a #GstGLShader
 * @index: attribute index to set
 * @name: name of the attribute
 *
 * Bind attribute @name to the specified location @index using
 * glBindFragDataLocation().
 */
void
gst_gl_shader_bind_frag_data_location (GstGLShader * shader,
    guint index, const gchar * name)
{
  GstGLShaderPrivate *priv;
  GstGLFuncs *gl;

  g_return_if_fail (shader != NULL);
  if (!_ensure_program (shader))
    g_return_if_fail (shader->priv->program_handle);
  priv = shader->priv;
  gl = shader->context->gl_vtable;
  g_return_if_fail (gl->BindFragDataLocation);

  GST_TRACE_OBJECT (shader, "binding program %i frag data \'%s\' location %i",
      (int) priv->program_handle, name, index);

  gl->BindFragDataLocation (priv->program_handle, index, name);
}