From 55158bed7fa17fee9d581d7ec5523ba187ca4c0d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 11 Jul 2024 10:12:21 -0700 Subject: [PATCH] util/glsl2spirv: only copy the input file if we're going to change it Should make the build slightly faster by only copying when we actually need to, and otherwise pointing at the original source Part-of: --- src/util/glsl2spirv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/glsl2spirv.py b/src/util/glsl2spirv.py index 9c061523ebd..00251416cdf 100644 --- a/src/util/glsl2spirv.py +++ b/src/util/glsl2spirv.py @@ -146,6 +146,9 @@ def postprocess_file(args: 'Arguments') -> None: def preprocess_file(args: 'Arguments', origin_file: T.TextIO, directory: os.PathLike, filemap: T.Dict[str, str]) -> str: + if args.create_entry is None and args.glsl_ver is None: + return origin_file.name + with open(os.path.join(directory, os.path.basename(origin_file.name)), "w") as copy_file: lines = origin_file.readlines()