util/glsl2spriv: make --vn required
authorDylan Baker <dylan.c.baker@intel.com>
Tue, 1 Nov 2022 19:55:12 +0000 (12:55 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Nov 2022 21:14:17 +0000 (21:14 +0000)
I'm not 100% sure whether it's right to make --vn required, or to avoid
the static conversion, but this seems correct. Mypy (type checking
coming soon) points out that if --vn is None then the
convert_to_static_variable function will fail. Our one use of this sets
--vn, so there is no change there. Making --vn required
ensures that it will never be None, avoiding the problem.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>

src/util/glsl2spirv.py

index fd5fa9c..1faec6f 100644 (file)
@@ -53,6 +53,7 @@ def get_args():
 
     parser.add_argument("--vn",
                         dest="vn",
+                        required=True,
                         help="Variable name. Creates a C header file that contains a uint32_t array.")
 
     parser.add_argument("--stage",