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

Tolga Dalman tolga.dalman at googlemail.com
Mon Apr 2 04:19:47 PDT 2012


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.

Best regards
Tolga Dalman


More information about the mesa-dev mailing list