util/glsl2spirv: add support for include directive

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
This commit is contained in:
Lionel Landwerlin 2023-01-01 21:08:32 +02:00 committed by Marge Bot
parent eae5aa943a
commit 234505f013

View file

@ -72,6 +72,13 @@ def get_args() -> 'Arguments':
default="vert",
choices=['vert', 'tesc', 'tese', 'geom', 'frag', 'comp'],
help="Uses specified stage rather than parsing the file extension")
parser.add_argument("-I",
dest="includes",
default=[],
action='append',
help="Include directory")
args = parser.parse_args()
return args
@ -157,6 +164,9 @@ def process_file(args: 'Arguments') -> None:
if args.create_entry is not None:
cmd_list.extend(["--entry-point", args.create_entry])
for f in args.includes:
cmd_list.append('-I' + f)
cmd_list.extend([
'-V',
'-o', args.output,