Re: [Mesa-dev] [PATCH 05/59] glsl: Generate strings that are the enum names without the ir_*op_ prefix

2016-10-26 Thread Ian Romanick
On 10/26/2016 02:46 AM, Iago Toral wrote:
> On Tue, 2016-10-25 at 17:59 -0700, Ian Romanick wrote:
>> From: Ian Romanick 
>>
>> For many expressions, this is different from the printable name.  The
>> printable name for ir_binop_add is "+", but we want "add".  This is
>> needed for ir_builder_print_visitor.
> 
> Reviewed-by: Iago Toral Quiroga 
> 
> I don't see why we need this exactly at this point in the series, but I
> suppose that will become obvious later on.

It's used two places in the next patch... just like the commit message
says (describes, anyway). :)

>> Signed-off-by: Ian Romanick 
>> ---
>>  src/compiler/glsl/ir.h   | 1 +
>>  src/compiler/glsl/ir_expression_operation.py | 6 ++
>>  2 files changed, 7 insertions(+)
>>
>> diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
>> index 3d28dd5..fcbe67d 100644
>> --- a/src/compiler/glsl/ir.h
>> +++ b/src/compiler/glsl/ir.h
>> @@ -1454,6 +1454,7 @@ public:
>>  #include "ir_expression_operation.h"
>>  
>>  extern const char *const
>> ir_expression_operation_strings[ir_last_opcode + 1];
>> +extern const char *const
>> ir_expression_operation_enum_strings[ir_last_opcode + 1];
>>  
>>  class ir_expression : public ir_rvalue {
>>  public:
>> diff --git a/src/compiler/glsl/ir_expression_operation.py
>> b/src/compiler/glsl/ir_expression_operation.py
>> index 9aa08d3..58a585b 100644
>> --- a/src/compiler/glsl/ir_expression_operation.py
>> +++ b/src/compiler/glsl/ir_expression_operation.py
>> @@ -707,6 +707,12 @@ const char *const
>> ir_expression_operation_strings[] = {
>>  % for item in values:
>> "${item.printable_name}",
>>  % endfor
>> +};
>> +
>> +const char *const ir_expression_operation_enum_strings[] = {
>> +% for item in values:
>> +   "${item.name}",
>> +% endfor
>>  };""")
>>  
>> constant_template = mako.template.Template("""\
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 05/59] glsl: Generate strings that are the enum names without the ir_*op_ prefix

2016-10-26 Thread Iago Toral
On Tue, 2016-10-25 at 17:59 -0700, Ian Romanick wrote:
> From: Ian Romanick 
> 
> For many expressions, this is different from the printable name.  The
> printable name for ir_binop_add is "+", but we want "add".  This is
> needed for ir_builder_print_visitor.

Reviewed-by: Iago Toral Quiroga 

I don't see why we need this exactly at this point in the series, but I
suppose that will become obvious later on.


> Signed-off-by: Ian Romanick 
> ---
>  src/compiler/glsl/ir.h   | 1 +
>  src/compiler/glsl/ir_expression_operation.py | 6 ++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
> index 3d28dd5..fcbe67d 100644
> --- a/src/compiler/glsl/ir.h
> +++ b/src/compiler/glsl/ir.h
> @@ -1454,6 +1454,7 @@ public:
>  #include "ir_expression_operation.h"
>  
>  extern const char *const
> ir_expression_operation_strings[ir_last_opcode + 1];
> +extern const char *const
> ir_expression_operation_enum_strings[ir_last_opcode + 1];
>  
>  class ir_expression : public ir_rvalue {
>  public:
> diff --git a/src/compiler/glsl/ir_expression_operation.py
> b/src/compiler/glsl/ir_expression_operation.py
> index 9aa08d3..58a585b 100644
> --- a/src/compiler/glsl/ir_expression_operation.py
> +++ b/src/compiler/glsl/ir_expression_operation.py
> @@ -707,6 +707,12 @@ const char *const
> ir_expression_operation_strings[] = {
>  % for item in values:
> "${item.printable_name}",
>  % endfor
> +};
> +
> +const char *const ir_expression_operation_enum_strings[] = {
> +% for item in values:
> +   "${item.name}",
> +% endfor
>  };""")
>  
> constant_template = mako.template.Template("""\
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 05/59] glsl: Generate strings that are the enum names without the ir_*op_ prefix

2016-10-25 Thread Ian Romanick
From: Ian Romanick 

For many expressions, this is different from the printable name.  The
printable name for ir_binop_add is "+", but we want "add".  This is
needed for ir_builder_print_visitor.

Signed-off-by: Ian Romanick 
---
 src/compiler/glsl/ir.h   | 1 +
 src/compiler/glsl/ir_expression_operation.py | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index 3d28dd5..fcbe67d 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -1454,6 +1454,7 @@ public:
 #include "ir_expression_operation.h"
 
 extern const char *const ir_expression_operation_strings[ir_last_opcode + 1];
+extern const char *const ir_expression_operation_enum_strings[ir_last_opcode + 
1];
 
 class ir_expression : public ir_rvalue {
 public:
diff --git a/src/compiler/glsl/ir_expression_operation.py 
b/src/compiler/glsl/ir_expression_operation.py
index 9aa08d3..58a585b 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -707,6 +707,12 @@ const char *const ir_expression_operation_strings[] = {
 % for item in values:
"${item.printable_name}",
 % endfor
+};
+
+const char *const ir_expression_operation_enum_strings[] = {
+% for item in values:
+   "${item.name}",
+% endfor
 };""")
 
constant_template = mako.template.Template("""\
-- 
2.5.5

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev