From afb3f21c9f1116db9e37c6158e98ab7856af815a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Jul 2020 16:15:16 -0700 Subject: [PATCH] freedreno/ir3_cmdline: Fix an uninit var warning. You could only access entry through the initialized path, but we can clean up the compiler warning by not keeping the other var. Part-of: --- src/gallium/drivers/freedreno/ir3/ir3_cmdline.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c index 81895a7aebe..c9dc7beff36 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c @@ -289,9 +289,8 @@ int main(int argc, char **argv) /* TODO cmdline option to target different gpus: */ unsigned gpu_id = 320; const char *info; - const char *entry; + const char *spirv_entry = NULL; void *ptr; - bool from_spirv = false; bool from_tgsi = false; size_t size; @@ -413,21 +412,20 @@ int main(int argc, char **argv) if (num_files != 0) errx(1, "in SPIR-V mode, only a single file may be specified"); stage = MESA_SHADER_COMPUTE; - from_spirv = true; filenames[num_files++] = filename; n++; if (n == argc) errx(1, "in SPIR-V mode, an entry point must be specified"); - entry = argv[n]; + spirv_entry = argv[n]; n++; } else if (strcmp(ext, ".comp") == 0) { - if (from_tgsi || from_spirv) + if (from_tgsi || spirv_entry) errx(1, "cannot mix GLSL/TGSI/SPIRV"); if (num_files >= ARRAY_SIZE(filenames)) errx(1, "too many GLSL files"); stage = MESA_SHADER_COMPUTE; } else if (strcmp(ext, ".frag") == 0) { - if (from_tgsi || from_spirv) + if (from_tgsi || spirv_entry) errx(1, "cannot mix GLSL/TGSI/SPIRV"); if (num_files >= ARRAY_SIZE(filenames)) errx(1, "too many GLSL files"); @@ -474,8 +472,8 @@ int main(int argc, char **argv) nir = tgsi_to_nir_noscreen(toks, nir_options); NIR_PASS_V(nir, nir_lower_global_vars_to_local); - } else if (from_spirv) { - nir = load_spirv(filenames[0], entry, stage); + } else if (spirv_entry) { + nir = load_spirv(filenames[0], spirv_entry, stage); NIR_PASS_V(nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out, -- 2.30.2