[Mesa-dev] [PATCH] glsl: Assign transform feedback varying slots in linker.

Marek Olšák maraeo at gmail.com
Mon Nov 7 17:34:15 PST 2011


On Tue, Nov 8, 2011 at 1:13 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> +/**
> + * Update gl_transform_feedback_info to reflect this tfeedback_decl.
> + *
> + * If an error occurs, the error is reported through linker_error() and false
> + * is returned.
> + */
> +bool
> +tfeedback_decl::store(struct gl_shader_program *prog,
> +                      struct gl_transform_feedback_info *info,
> +                      unsigned buffer) const
> +{
> +   if (!this->is_assigned()) {
> +      /* From GL_EXT_transform_feedback:
> +       *   A program will fail to link if:
> +       *
> +       *   * any variable name specified in the <varyings> array is not
> +       *     declared as an output in the geometry shader (if present) or
> +       *     the vertex shader (if no geometry shader is present);
> +       */
> +      linker_error(prog, "Transform feedback varying %s undeclared.",
> +                   this->orig_name);
> +      return false;
> +   }
> +   for (unsigned v = 0; v < this->vector_elements; ++v) {

I think the number of iterations should be this->matrix_columns, not
this->vector_elements.

Marek

> +      info->Outputs[info->NumOutputs].OutputRegister = this->location + v;
> +      info->Outputs[info->NumOutputs].NumComponents = this->vector_elements;
> +      info->Outputs[info->NumOutputs].OutputBuffer = buffer;
> +      ++info->NumOutputs;
> +   }
> +   return true;
> +}


More information about the mesa-dev mailing list