Mesa (main): zink: fix more initializer styles

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 16 13:15:55 UTC 2021


Module: Mesa
Branch: main
Commit: 0ee48216ddbb949a73369ae378f3a4aebaa9c56e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ee48216ddbb949a73369ae378f3a4aebaa9c56e

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Jun 15 08:31:21 2021 -0700

zink: fix more initializer styles

Empty initializer lists are a GCC extension, let's use the syntax that
compilers like MSVC also supports.

Reviewed-by: Hoe Hao Cheng <haochengho12907 at gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>

---

 src/gallium/drivers/zink/zink_descriptors_lazy.c | 6 +++---
 src/gallium/drivers/zink/zink_state.c            | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_descriptors_lazy.c b/src/gallium/drivers/zink/zink_descriptors_lazy.c
index 62743f2d415..4e832ddfc0c 100644
--- a/src/gallium/drivers/zink/zink_descriptors_lazy.c
+++ b/src/gallium/drivers/zink/zink_descriptors_lazy.c
@@ -126,7 +126,7 @@ zink_descriptor_program_init_lazy(struct zink_context *ctx, struct zink_program
    struct zink_screen *screen = zink_screen(ctx->base.screen);
    VkDescriptorSetLayoutBinding bindings[ZINK_DESCRIPTOR_TYPES][PIPE_SHADER_TYPES * 32];
    VkDescriptorUpdateTemplateEntry entries[ZINK_DESCRIPTOR_TYPES][PIPE_SHADER_TYPES * 32];
-   unsigned num_bindings[ZINK_DESCRIPTOR_TYPES] = {};
+   unsigned num_bindings[ZINK_DESCRIPTOR_TYPES] = {0};
    uint8_t has_bindings = 0;
 
    struct zink_shader **stages;
@@ -141,7 +141,7 @@ zink_descriptor_program_init_lazy(struct zink_context *ctx, struct zink_program
       return false;
 
    unsigned push_count = 0;
-   unsigned entry_idx[ZINK_DESCRIPTOR_TYPES] = {};
+   unsigned entry_idx[ZINK_DESCRIPTOR_TYPES] = {0};
 
    unsigned num_shaders = pg->is_compute ? 1 : ZINK_SHADER_COUNT;
    bool have_push = screen->info.have_KHR_push_descriptor;
@@ -228,7 +228,7 @@ zink_descriptor_program_init_lazy(struct zink_context *ctx, struct zink_program
    if (!screen->info.have_KHR_descriptor_update_template || screen->descriptor_mode == ZINK_DESCRIPTOR_MODE_NOTEMPLATES)
       return true;
 
-   VkDescriptorUpdateTemplateCreateInfo template[ZINK_DESCRIPTOR_TYPES + 1] = {};
+   VkDescriptorUpdateTemplateCreateInfo template[ZINK_DESCRIPTOR_TYPES + 1] = {0};
    /* type of template */
    VkDescriptorUpdateTemplateType types[ZINK_DESCRIPTOR_TYPES + 1] = {VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET};
    if (have_push && screen->descriptor_mode == ZINK_DESCRIPTOR_MODE_LAZY)
diff --git a/src/gallium/drivers/zink/zink_state.c b/src/gallium/drivers/zink/zink_state.c
index 135203e0184..bc9fd3e8e09 100644
--- a/src/gallium/drivers/zink/zink_state.c
+++ b/src/gallium/drivers/zink/zink_state.c
@@ -251,7 +251,7 @@ zink_create_blend_state(struct pipe_context *pctx,
       if (blend_state->independent_blend_enable)
          rt = blend_state->rt + i;
 
-      VkPipelineColorBlendAttachmentState att = { };
+      VkPipelineColorBlendAttachmentState att = {0};
 
       if (rt->blend_enable) {
          att.blendEnable = VK_TRUE;



More information about the mesa-commit mailing list