[Mesa-dev] [PATCH 28/64] isl/state: Don't use designated initializers for buffer surface state

Emil Velikov emil.l.velikov at gmail.com
Mon Jun 13 08:50:52 UTC 2016


Hi Jason,

Why do you remove the C99 initializer ? Anything wrong with using it ?

On 11 June 2016 at 17:02, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  src/intel/isl/isl_surface_state.c | 46 +++++++++++++++++++--------------------
>  1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
> index ca13175..2026f80 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -427,40 +427,40 @@ isl_genX(buffer_fill_state_s)(void *state,
>        assert(num_elements <= (1ull << 27));
>     }
>
> -   struct GENX(RENDER_SURFACE_STATE) surface_state = {
> -      .SurfaceType = SURFTYPE_BUFFER,
> -      .SurfaceArray = false,
> -      .SurfaceFormat = info->format,
> -      .SurfaceVerticalAlignment = isl_to_gen_valign[4],
> -      .SurfaceHorizontalAlignment = isl_to_gen_halign[4],
> -      .Height = ((num_elements - 1) >> 7) & 0x3fff,
> -      .Width = (num_elements - 1) & 0x7f,
> -      .Depth = ((num_elements - 1) >> 21) & 0x3f,
> -      .SurfacePitch = info->stride - 1,
> -      .NumberofMultisamples = MULTISAMPLECOUNT_1,
> +   struct GENX(RENDER_SURFACE_STATE) s = { 0 };
> +
> +   s.SurfaceType = SURFTYPE_BUFFER,
Are you sure that this patch builds ? Shouldn't we be using semicolon
and the end of the above line (plus all the ones below) ?

-Emil


More information about the mesa-dev mailing list