[Mesa-dev] [PATCH 1/2] mesa: Fix glGetTransformFeedbackVarying().

Eric Anholt eric at anholt.net
Wed Jan 4 00:30:17 PST 2012


On Tue, 03 Jan 2012 19:19:16 -0800, Ian Romanick <idr at freedesktop.org> wrote:
> On 01/03/2012 06:52 PM, Eric Anholt wrote:
> > The current implementation was totally broken -- it was looking in an
> > unpopulated structure for varyings, and trying to do so using the
> > current list of varying names, not the list used at link time.
> > ---
> >   src/glsl/linker.cpp               |   37 +++++++++++++++++++++++++++++++------
> >   src/mesa/main/mtypes.h            |   21 ++++++++++++++++++++-
> >   src/mesa/main/transformfeedback.c |   37 +++++++++++--------------------------
> >   3 files changed, 62 insertions(+), 33 deletions(-)
> >
> > diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> > index 6587008..bf72a55 100644
> > --- a/src/glsl/linker.cpp
> > +++ b/src/glsl/linker.cpp
> > @@ -1580,7 +1587,7 @@ tfeedback_decl::assign_location(struct gl_context *ctx,
> >   bool
> >   tfeedback_decl::store(struct gl_shader_program *prog,
> >                         struct gl_transform_feedback_info *info,
> > -                      unsigned buffer) const
> > +                      unsigned buffer, unsigned varying) const
> >   {
> >      if (!this->is_assigned()) {
> >         /* From GL_EXT_transform_feedback:
> > @@ -1602,6 +1609,16 @@ tfeedback_decl::store(struct gl_shader_program *prog,
> >         ++info->NumOutputs;
> >         info->BufferStride[buffer] += this->vector_elements;
> >      }
> > +
> > +   info->Varyings[varying].Name = ralloc_strdup(prog, this->orig_name);
> 
> Judging from the ralloc_free in the next hunk, is prog the right 
> context?  It seems like info->Varyings is better.

Good catch.  At one point I had info->Varyings was embedded in the info,
which made this make sense.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120104/0b302b68/attachment-0001.pgp>


More information about the mesa-dev mailing list