[Mesa-dev] [PATCH] mesa/st: indentation tidy-up

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue May 30 07:19:35 UTC 2017


Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 05/30/2017 02:26 AM, Timothy Arceri wrote:
> ---
>   src/mesa/state_tracker/st_mesa_to_tgsi.c | 65 ++++++++++++++++----------------
>   1 file changed, 32 insertions(+), 33 deletions(-)
> 
> diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
> index ce75cf7..2d12de2 100644
> --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
> +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
> @@ -931,56 +931,55 @@ st_translate_mesa_program(
>   
>      /* Declare address register.
>       */
>      if (program->arb.NumAddressRegs > 0) {
>         debug_assert( program->arb.NumAddressRegs == 1 );
>         t->address[0] = ureg_DECL_address( ureg );
>      }
>   
>      /* Declare misc input registers
>       */
> -   {
> -      GLbitfield sysInputs = program->info.system_values_read;
> -
> -      for (i = 0; sysInputs; i++) {
> -         if (sysInputs & (1 << i)) {
> -            unsigned semName = _mesa_sysval_to_semantic(i);
> -
> -            t->systemValues[i] = ureg_DECL_system_value(ureg, semName, 0);
> -
> -            if (semName == TGSI_SEMANTIC_INSTANCEID ||
> -                semName == TGSI_SEMANTIC_VERTEXID) {
> -               /* From Gallium perspective, these system values are always
> -                * integer, and require native integer support.  However, if
> -                * native integer is supported on the vertex stage but not the
> -                * pixel stage (e.g, i915g + draw), Mesa will generate IR that
> -                * assumes these system values are floats. To resolve the
> -                * inconsistency, we insert a U2F.
> -                */
> -               struct st_context *st = st_context(ctx);
> -               struct pipe_screen *pscreen = st->pipe->screen;
> -               assert(procType == PIPE_SHADER_VERTEX);
> -               assert(pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_INTEGERS));
> -               (void) pscreen;  /* silence non-debug build warnings */
> -               if (!ctx->Const.NativeIntegers) {
> -                  struct ureg_dst temp = ureg_DECL_local_temporary(t->ureg);
> -                  ureg_U2F( t->ureg, ureg_writemask(temp, TGSI_WRITEMASK_X), t->systemValues[i]);
> -                  t->systemValues[i] = ureg_scalar(ureg_src(temp), 0);
> -               }
> +   GLbitfield sysInputs = program->info.system_values_read;
> +   for (i = 0; sysInputs; i++) {
> +      if (sysInputs & (1 << i)) {
> +         unsigned semName = _mesa_sysval_to_semantic(i);
> +
> +         t->systemValues[i] = ureg_DECL_system_value(ureg, semName, 0);
> +
> +         if (semName == TGSI_SEMANTIC_INSTANCEID ||
> +             semName == TGSI_SEMANTIC_VERTEXID) {
> +            /* From Gallium perspective, these system values are always
> +             * integer, and require native integer support.  However, if
> +             * native integer is supported on the vertex stage but not the
> +             * pixel stage (e.g, i915g + draw), Mesa will generate IR that
> +             * assumes these system values are floats. To resolve the
> +             * inconsistency, we insert a U2F.
> +             */
> +            struct st_context *st = st_context(ctx);
> +            struct pipe_screen *pscreen = st->pipe->screen;
> +            assert(procType == PIPE_SHADER_VERTEX);
> +            assert(pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX,
> +                   PIPE_SHADER_CAP_INTEGERS));
> +            (void) pscreen;  /* silence non-debug build warnings */
> +            if (!ctx->Const.NativeIntegers) {
> +               struct ureg_dst temp = ureg_DECL_local_temporary(t->ureg);
> +               ureg_U2F(t->ureg, ureg_writemask(temp, TGSI_WRITEMASK_X),
> +                        t->systemValues[i]);
> +               t->systemValues[i] = ureg_scalar(ureg_src(temp), 0);
>               }
> +         }
>   
> -            if (procType == PIPE_SHADER_FRAGMENT &&
> -                semName == TGSI_SEMANTIC_POSITION)
> -               emit_wpos(st_context(ctx), t, program, ureg);
> +         if (procType == PIPE_SHADER_FRAGMENT &&
> +             semName == TGSI_SEMANTIC_POSITION)
> +            emit_wpos(st_context(ctx), t, program, ureg);
>   
> -            sysInputs &= ~(1 << i);
> -         }
> +          sysInputs &= ~(1 << i);
>         }
>      }
>   
>      if (program->arb.IndirectRegisterFiles & (1 << PROGRAM_TEMPORARY)) {
>         /* If temps are accessed with indirect addressing, declare temporaries
>          * in sequential order.  Else, we declare them on demand elsewhere.
>          */
>         for (i = 0; i < program->arb.NumTemporaries; i++) {
>            /* XXX use TGSI_FILE_TEMPORARY_ARRAY when it's supported by ureg */
>            t->temps[i] = ureg_DECL_temporary( t->ureg );
> 


More information about the mesa-dev mailing list