[Mesa-dev] [PATCH] glsl: fix variable ordering in the output_read_remover

Vadim Girlin vadimgirlin at gmail.com
Tue Apr 3 06:29:15 PDT 2012


On Mon, 2012-04-02 at 13:19 +0200, Tolga Dalman wrote:
> Hi,
> 
> On 31.03.2012 20:23, Vadim Girlin wrote:
> > Use the hash of the variable name string instead of the pointer value.
> > 
> > Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
> > ---
> > 
> > This patch solves the problem for me, afaics.
> > Tested with quick-driver.tests
> > 
> >  src/glsl/lower_output_reads.cpp |    9 ++++++++-
> >  1 files changed, 8 insertions(+), 1 deletions(-)
> > 
> > diff --git a/src/glsl/lower_output_reads.cpp b/src/glsl/lower_output_reads.cpp
> > index 415b541..151a09b 100644
> > --- a/src/glsl/lower_output_reads.cpp
> > +++ b/src/glsl/lower_output_reads.cpp
> > @@ -54,11 +54,18 @@ public:
> >     virtual ir_visitor_status visit_leave(class ir_function_signature *);
> >  };
> >  
> > +static unsigned
> > +hash_table_var_hash(const void *key)
> > +{
> > +   ir_variable *var = (ir_variable*) key;
> 
> Why not use const ir_variable instead ? In that case the cast
> wouldn't be necessary I suppose.

Sorry, I don't understand what exactly you're suggesting to change.

"const ir_variable *var = key;" ?

Build fails with:
"error: invalid conversion from ‘const void*’ to ‘const ir_variable*’ [-fpermissive]"

Vadim

> 
> Best regards
> Tolga Dalman
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev





More information about the mesa-dev mailing list