Module: Mesa
Branch: main
Commit: da1e39faa4eb30981253519e32582d569f96403a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=da1e39faa4eb30981253519e32582d569f96403a

Author: Lionel Landwerlin <[email protected]>
Date:   Sun Sep 17 13:38:50 2023 +0300

util/glsl2spirv: add ability to pass defines

Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Ivan Briano <[email protected]>
Tested-by: Felix DeGrood <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>

---

 src/util/glsl2spirv.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/util/glsl2spirv.py b/src/util/glsl2spirv.py
index 4df5abd4e27..5e2198a3f74 100644
--- a/src/util/glsl2spirv.py
+++ b/src/util/glsl2spirv.py
@@ -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,

Reply via email to