[Mesa-dev] [PATCH 05/10] glsl/linker: Defer recording transform feedback locations.

Paul Berry stereotype441 at gmail.com
Wed Dec 12 13:35:21 PST 2012


On 12 December 2012 13:32, Eric Anholt <eric at anholt.net> wrote:

> Paul Berry <stereotype441 at gmail.com> writes:
>
> > This patch subdivides the loop that assigns varying locations into two
> > phases: one phase to match up varyings between shader stages (and
> > assign them varying locations), and a second phase to record the
> > varying assignments for use by transform feedback.
>
>
> > -bool
> > -tfeedback_decl::accumulate_num_outputs(struct gl_shader_program *prog,
> > -                                       unsigned *count)
> > +unsigned
> > +tfeedback_decl::accumulate_num_outputs(struct gl_shader_program *prog)
> >  {
> >     if (!this->is_varying()) {
> > -      return true;
> > -   }
> > -
> > -   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;
> > +      return 0;
> >     }
> >
> >     unsigned translated_size = this->size;
> >     if (this->is_clip_distance_mesa)
> >        translated_size = (translated_size + 3) / 4;
> >
> > -   *count += translated_size * this->matrix_columns;
> > -
> > -   return true;
> > +   return translated_size * this->matrix_columns;
> >  }
>
> It looks like this function is no longer accumulate_num_outputs(), and
> might be better called get_num_outputs() now.  Also I think the prog
> argument can go away.
>

Good point.  I'll fix this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121212/34d151c1/attachment.html>


More information about the mesa-dev mailing list