panfrost: Fix gnu-empty-initializer errors.
authorVinson Lee <vlee@freedesktop.org>
Tue, 1 Sep 2020 23:21:47 +0000 (16:21 -0700)
committerVinson Lee <vlee@freedesktop.org>
Fri, 4 Sep 2020 01:47:49 +0000 (18:47 -0700)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3473
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6551>

src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_resource.c
src/panfrost/lib/gen_pack.py

index b231fc8e0033b24d72c527aa26ad4a64665cf299..c2fcb3ac59ca89acae4d344f24e95e3d528ee971 100644 (file)
@@ -241,7 +241,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
         s->info.stage = stage;
 
         /* Call out to Midgard compiler given the above NIR */
-        panfrost_program program = {};
+        panfrost_program program = {0};
         memcpy(program.rt_formats, state->rt_formats, sizeof(program.rt_formats));
 
         if (dev->quirks & IS_BIFROST) {
index 777725d0a267dac850e23cdf047d7d46a0cdcadb..2e5ddc3e0b5e15425bd5b3423ea250950c4a77af 100644 (file)
@@ -296,7 +296,7 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts,
         }
 
         for (unsigned i = 0; i < rt_count; ++i) {
-                struct mali_blend_flags_packed flags = {};
+                struct mali_blend_flags_packed flags = {0};
 
                 pan_pack(&flags, BLEND_FLAGS, cfg) {
                         if (blend[i].no_colour) {
index a34656b5bdfa3a96516b4b043731ae068cd68b75..046a452cb04a1afc5c3efa274a36ad50a3e1c604 100644 (file)
@@ -730,7 +730,7 @@ static void
 pan_blit_from_staging(struct pipe_context *pctx, struct panfrost_gtransfer *trans)
 {
         struct pipe_resource *dst = trans->base.resource;
-        struct pipe_blit_info blit = {};
+        struct pipe_blit_info blit = {0};
 
         blit.dst.resource = dst;
         blit.dst.format   = dst->format;
@@ -750,7 +750,7 @@ static void
 pan_blit_to_staging(struct pipe_context *pctx, struct panfrost_gtransfer *trans)
 {
         struct pipe_resource *src = trans->base.resource;
-        struct pipe_blit_info blit = {};
+        struct pipe_blit_info blit = {0};
 
         blit.src.resource = src;
         blit.src.format   = src->format;
index cf3e0feee2224874c4cda9c336d927fabc0090b6..5665f421efe1087ef1cf571a99c16190e00c6260 100644 (file)
@@ -584,7 +584,10 @@ class Parser(object):
                 default_fields.append("   .{} = {{ {}_header }}".format(field.name, self.gen_prefix(safe_name(field.type.upper()))))
 
         print('#define %-40s\\' % (name + '_header'))
-        print(",  \\\n".join(default_fields))
+        if default_fields:
+            print(",  \\\n".join(default_fields))
+        else:
+            print('   0')
         print('')
 
     def emit_template_struct(self, name, group, opaque_structs):