[Mesa-dev] [PATCH] glsl: Fix indent in dump code

tournier.elie tournier.elie at gmail.com
Mon Mar 20 17:05:43 UTC 2017


On 8 March 2017 at 14:56, tournier.elie <tournier.elie at gmail.com> wrote:
> Right.
> But did we generate lots of files w/ this method?
> I only files I know are udivmod64.h and builtin_int64.h that you
> generated for ARB_gpu_shader_int64. And these files are not impacted.

Ping.
Is anyone know the files generated by the standalone compiler?
If yes, is this patch impact these files?

>
> On 7 March 2017 at 20:23, Ian Romanick <idr at freedesktop.org> wrote:
>> Since this will affect generated code that is tracked in GIT, a second
>> patch should regenerate all those files.  Otherwise the next patch that
>> causes those files to be regenerated will include a bunch of spurious
>> changes.
>>
>> This is one of the (very strong) arguments against this sort of
>> architecture. :(
>>
>> On 03/06/2017 07:27 AM, Elie Tournier wrote:
>>> From: Elie Tournier <tournier.elie at gmail.com>
>>>
>>> Signed-off-by: Elie Tournier <elie.tournier at collabora.com>
>>> ---
>>> On an other thread [1], we discovered than the GLSL compiler have some trouble to indent correctly the dump IR.
>>>
>>> I don't have git access, please push it for me.
>>>
>>> [1] https://lists.freedesktop.org/archives/mesa-dev/2017-March/146518.html
>>> ---
>>>  src/compiler/glsl/ir_builder_print_visitor.cpp | 14 +++++++-------
>>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp b/src/compiler/glsl/ir_builder_print_visitor.cpp
>>> index 825dbe148e..02f15e74ee 100644
>>> --- a/src/compiler/glsl/ir_builder_print_visitor.cpp
>>> +++ b/src/compiler/glsl/ir_builder_print_visitor.cpp
>>> @@ -372,17 +372,17 @@ ir_builder_print_visitor::visit(ir_constant *ir)
>>>           switch (ir->type->base_type) {
>>>           case GLSL_TYPE_UINT:
>>>              if (ir->value.u[i] != 0)
>>> -               print_without_indent("r%04X_data.u[%u] = %u;\n",
>>> +               print_with_indent("r%04X_data.u[%u] = %u;\n",
>>>                                      my_index, i, ir->value.u[i]);
>>>              break;
>>>           case GLSL_TYPE_INT:
>>>              if (ir->value.i[i] != 0)
>>> -               print_without_indent("r%04X_data.i[%u] = %i;\n",
>>> +               print_with_indent("r%04X_data.i[%u] = %i;\n",
>>>                                      my_index, i, ir->value.i[i]);
>>>              break;
>>>           case GLSL_TYPE_FLOAT:
>>>              if (ir->value.u[i] != 0)
>>> -               print_without_indent("r%04X_data.u[%u] = 0x%08x; /* %f */\n",
>>> +               print_with_indent("r%04X_data.u[%u] = 0x%08x; /* %f */\n",
>>>                                      my_index,
>>>                                      i,
>>>                                      ir->value.u[i],
>>> @@ -395,27 +395,27 @@ ir_builder_print_visitor::visit(ir_constant *ir)
>>>
>>>              memcpy(&v, &ir->value.d[i], sizeof(v));
>>>              if (v != 0)
>>> -               print_without_indent("r%04X_data.u64[%u] = 0x%016" PRIx64 "; /* %g */\n",
>>> +               print_with_indent("r%04X_data.u64[%u] = 0x%016" PRIx64 "; /* %g */\n",
>>>                                      my_index, i, v, ir->value.d[i]);
>>>              break;
>>>           }
>>>           case GLSL_TYPE_UINT64:
>>>              if (ir->value.u64[i] != 0)
>>> -               print_without_indent("r%04X_data.u64[%u] = %" PRIu64 ";\n",
>>> +               print_with_indent("r%04X_data.u64[%u] = %" PRIu64 ";\n",
>>>                                      my_index,
>>>                                      i,
>>>                                      ir->value.u64[i]);
>>>              break;
>>>           case GLSL_TYPE_INT64:
>>>              if (ir->value.i64[i] != 0)
>>> -               print_without_indent("r%04X_data.i64[%u] = %" PRId64 ";\n",
>>> +               print_with_indent("r%04X_data.i64[%u] = %" PRId64 ";\n",
>>>                                      my_index,
>>>                                      i,
>>>                                      ir->value.i64[i]);
>>>              break;
>>>           case GLSL_TYPE_BOOL:
>>>              if (ir->value.u[i] != 0)
>>> -               print_without_indent("r%04X_data.u[%u] = 1;\n", my_index, i);
>>> +               print_with_indent("r%04X_data.u[%u] = 1;\n", my_index, i);
>>>              break;
>>>           default:
>>>              unreachable("Invalid constant type");
>>>
>>


More information about the mesa-dev mailing list