[Mesa-dev] [PATCH 3/4] freedreno/ir3: Add missing braces in initializer

Eric Engestrom eric.engestrom at imgtec.com
Thu Jul 28 08:21:15 UTC 2016


On Wed, Jul 27, 2016 at 07:37:56PM +0200, Francesco Ansanelli wrote:
> Hello,
> 
> unluckily this didn't fix the warning...
> I've done some more compile testing and found this solution:
> 
> - static struct ir3_shader_key key = {{0}};
> +static struct ir3_shader_key key = {{{0, 0, 0, 0, 0, 0, 0, 0}}, 0, 0, 0,
> 0, 0, 0, 0, 0};

So there are 3 levels of structs? The proper fix IMHO should then be
{{{0}}}, as the rest of the 0's are implied.
Can you test if that fixes it?

> 
> is this correct? Should I send a new patch?
> 
> Cheers,
> Francesco
> 
> 2016-07-20 9:49 GMT+02:00 Francesco Ansanelli <francians at gmail.com>:
> 
> > ---
> >  src/gallium/drivers/freedreno/ir3/ir3_shader.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.c
> > b/src/gallium/drivers/freedreno/ir3/ir3_shader.c
> > index 9f39f9f..5d57c0b 100644
> > --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.c
> > +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.c
> > @@ -309,7 +309,7 @@ ir3_shader_create(struct ir3_compiler *compiler,
> >                  * (as otherwise nothing will trigger the shader to be
> >                  * actually compiled)
> >                  */
> > -               static struct ir3_shader_key key = {0};
> > +               static struct ir3_shader_key key = {{0}};
> >                 ir3_shader_variant(shader, key, debug);
> >         }
> >         return shader;
> > --
> > 1.7.9.5
> >
> >


More information about the mesa-dev mailing list