From: Dylan Baker Date: Tue, 1 Nov 2022 20:29:48 +0000 (-0700) Subject: util/glsl2spirv: cleanup list extension X-Git-Tag: upstream/23.3.3~17118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a85d2ed984fc9a6267861242d4ae12f2aae3d52;p=platform%2Fupstream%2Fmesa.git util/glsl2spirv: cleanup list extension - consistently use list.extend instead of list +=, which has gotchas - condense list extension calls when possible Reviewed-by: Luis Felipe Strano Moraes Part-of: --- diff --git a/src/util/glsl2spirv.py b/src/util/glsl2spirv.py index e4ae22f..c41f1fd 100644 --- a/src/util/glsl2spirv.py +++ b/src/util/glsl2spirv.py @@ -145,22 +145,23 @@ def process_file(args: Arguments) -> None: cmd_list = ["glslangValidator"] if args.Olib: - cmd_list += ["--keep-uncalled"] + cmd_list.append("--keep-uncalled") if args.vn is not None: - cmd_list += ["--variable-name", args.vn] + cmd_list.extend(["--variable-name", args.vn]) if args.extra is not None: cmd_list.append(args.extra) if args.create_entry is not None: - cmd_list += ["--entry-point", args.create_entry] - - cmd_list.append("-V") - cmd_list += ["-o", args.output] - cmd_list += ["-S", args.stage] - - cmd_list.append(copy_file) + cmd_list.extend(["--entry-point", args.create_entry]) + + cmd_list.extend([ + '-V', + '-o', args.output, + '-S', args.stage, + copy_file, + ]) ret = subprocess.run(cmd_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=30) if ret.returncode != 0: