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 <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
This commit is contained in:
Dylan Baker
2022-11-01 13:29:48 -07:00
committed by Marge Bot
parent 9a165945a9
commit 9a85d2ed98

View File

@@ -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.extend(["--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([
'-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: