util/glsl2spirv: add ability to pass defines

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
This commit is contained in:
Lionel Landwerlin 2023-09-17 13:38:50 +03:00 committed by Marge Bot
parent c700d47c56
commit da1e39faa4

View file

@ -79,6 +79,12 @@ def get_args() -> 'Arguments':
action='append',
help="Include directory")
parser.add_argument("-D",
dest="defines",
default=[],
action='append',
help="Defines")
args = parser.parse_args()
return args
@ -167,6 +173,9 @@ def process_file(args: 'Arguments') -> None:
for f in args.includes:
cmd_list.append('-I' + f)
for d in args.defines:
cmd_list.append('-D' + d)
cmd_list.extend([
'-V',
'-o', args.output,