[Mesa-dev] [PATCH 1/4] mesa: fix indentation in _mesa_associate_uniform_storage()

tournier.elie tournier.elie at gmail.com
Mon May 15 12:44:06 UTC 2017


Hello Samuel,

With the small fix below, the series is:
Reviewed-by: Elie Tournier <elie.tournier at collabora.com>


On 15 May 2017 at 11:55, Samuel Pitoiset <samuel.pitoiset at gmail.com> wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/mesa/program/ir_to_mesa.cpp | 101 +++++++++++++++++++---------------------
>  1 file changed, 49 insertions(+), 52 deletions(-)
>
> diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
> index 05b042b4e9..0e8623c3f3 100644
> --- a/src/mesa/program/ir_to_mesa.cpp
> +++ b/src/mesa/program/ir_to_mesa.cpp
> @@ -2534,7 +2534,7 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
>
>  void
>  _mesa_associate_uniform_storage(struct gl_context *ctx,
> -                               struct gl_shader_program *shader_program,
> +                                struct gl_shader_program *shader_program,
>                                  struct gl_program_parameter_list *params,
>                                  bool propagate_to_storage)
>  {
> @@ -2545,15 +2545,15 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
>     unsigned last_location = unsigned(~0);
>     for (unsigned i = 0; i < params->NumParameters; i++) {
>        if (params->Parameters[i].Type != PROGRAM_UNIFORM)
> -        continue;
> +         continue;
>
>        unsigned location;
>        const bool found =
> -        shader_program->UniformHash->get(location, params->Parameters[i].Name);
> +         shader_program->UniformHash->get(location, params->Parameters[i].Name);
>        assert(found);
>
>        if (!found)
> -        continue;
> +         continue;
>
>        struct gl_uniform_storage *storage =
>           &shader_program->data->UniformStorage[location];
> @@ -2563,48 +2563,47 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
>           continue;
>
>        if (location != last_location) {
> -        enum gl_uniform_driver_format format = uniform_native;
> +         enum gl_uniform_driver_format format = uniform_native;
> +         unsigned columns = 0;
> +         int dmul = 4 * sizeof(float);
>
> -        unsigned columns = 0;
> -        int dmul = 4 * sizeof(float);
> -        switch (storage->type->base_type) {
> +         switch (storage->type->base_type) {
>           case GLSL_TYPE_UINT64:
> -           if (storage->type->vector_elements > 2)
> +            if (storage->type->vector_elements > 2)
>                 dmul *= 2;
> -           /* fallthrough */
> -        case GLSL_TYPE_UINT:
> -           assert(ctx->Const.NativeIntegers);
> -           format = uniform_native;
> -           columns = 1;
> -           break;
> +            /* fallthrough */
> +         case GLSL_TYPE_UINT:
> +            assert(ctx->Const.NativeIntegers);
> +            format = uniform_native;
> +            columns = 1;
> +            break;
>           case GLSL_TYPE_INT64:
> -           if (storage->type->vector_elements > 2)
> +            if (storage->type->vector_elements > 2)
>                 dmul *= 2;
> -           /* fallthrough */
> -        case GLSL_TYPE_INT:
> -           format =
> -              (ctx->Const.NativeIntegers) ? uniform_native : uniform_int_float;
> -           columns = 1;
> -           break;
> -
> -        case GLSL_TYPE_DOUBLE:
> -           if (storage->type->vector_elements > 2)
> +            /* fallthrough */
> +         case GLSL_TYPE_INT:
> +            format =
> +               (ctx->Const.NativeIntegers) ? uniform_native : uniform_int_float;
> +            columns = 1;
> +            break;
> +         case GLSL_TYPE_DOUBLE:
> +            if (storage->type->vector_elements > 2)
>                 dmul *= 2;
> -           /* fallthrough */
> -        case GLSL_TYPE_FLOAT:
> -           format = uniform_native;
> -           columns = storage->type->matrix_columns;
> -           break;
> -        case GLSL_TYPE_BOOL:
> -           format = uniform_native;
> -           columns = 1;
> -           break;
> -        case GLSL_TYPE_SAMPLER:
> -        case GLSL_TYPE_IMAGE:
> +            /* fallthrough */
> +         case GLSL_TYPE_FLOAT:
> +            format = uniform_native;
> +            columns = storage->type->matrix_columns;
> +            break;
> +         case GLSL_TYPE_BOOL:
> +            format = uniform_native;
> +            columns = 1;
> +            break;
> +         case GLSL_TYPE_SAMPLER:
> +         case GLSL_TYPE_IMAGE:
>           case GLSL_TYPE_SUBROUTINE:
> -           format = uniform_native;
> -           columns = 1;
> -           break;
> +            format = uniform_native;
> +            columns = 1;
> +            break;
>           case GLSL_TYPE_ATOMIC_UINT:
>           case GLSL_TYPE_ARRAY:
>           case GLSL_TYPE_VOID:
> @@ -2612,27 +2611,25 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
>           case GLSL_TYPE_ERROR:
>           case GLSL_TYPE_INTERFACE:
>           case GLSL_TYPE_FUNCTION:
> -           assert(!"Should not get here.");
> -           break;
> -        }
> +            assert(!"Should not get here.");
> +            break;
> +         }
>
> -        _mesa_uniform_attach_driver_storage(storage,
> -                                            dmul * columns,
> -                                            dmul,
> -                                            format,
> -                                            &params->ParameterValues[i]);
> +         _mesa_uniform_attach_driver_storage(storage,dmul * columns, dmul,

          ^
Just need a space between "storage" and "dmul"

> +                                             format,
> +                                             &params->ParameterValues[i]);
>
> -        /* After attaching the driver's storage to the uniform, propagate any
> -         * data from the linker's backing store.  This will cause values from
> -         * initializers in the source code to be copied over.
> -         */
> +         /* After attaching the driver's storage to the uniform, propagate any
> +          * data from the linker's backing store.  This will cause values from
> +          * initializers in the source code to be copied over.
> +          */
>           if (propagate_to_storage) {
>              unsigned array_elements = MAX2(1, storage->array_elements);
>              _mesa_propagate_uniforms_to_driver_storage(storage, 0,
>                                                         array_elements);
>           }
>
> -        last_location = location;
> +             last_location = location;
>        }
>     }
>  }
> --
> 2.13.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list