diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:38:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:38:23 +0000 |
commit | ff6e3c025658a5fa1affd094f220b623e7e1b24b (patch) | |
tree | 9faab72d69c92d24e349d184f5869b9796f17e0c /tools/glsl_preproc/main.py | |
parent | Initial commit. (diff) | |
download | libplacebo-upstream.tar.xz libplacebo-upstream.zip |
Adding upstream version 6.338.2.upstream/6.338.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/glsl_preproc/main.py')
-rwxr-xr-x | tools/glsl_preproc/main.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/glsl_preproc/main.py b/tools/glsl_preproc/main.py new file mode 100755 index 0000000..fcfea1f --- /dev/null +++ b/tools/glsl_preproc/main.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import sys +import argparse + +from macros import Macro + +parser = argparse.ArgumentParser() +parser.add_argument('input') +parser.add_argument('output') +parser.add_argument('-s', '--strip', default=False, action='store_true') +args = parser.parse_args() + +with open(args.input) as infile: + with open(args.output, 'w') as outfile: + for line in Macro.process_file(infile, strip=args.strip): + outfile.write(line) |