summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins/tools
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2011-10-06 10:31:34 -0700
committerPaul Berry <[email protected]>2011-10-31 11:24:03 -0700
commitb6f32bbe12e1082e78951b6ef073bf244ba0b8b7 (patch)
treefed07bc4fc6b1d5d0a78d1dcb3403e6bf920c9d6 /src/glsl/builtins/tools
parentb726639e1be0614fb6bbb75a6f07c63eacc6d787 (diff)
glsl: Add '.ir' extension to builtin IR files
This patch adds the extension '.ir' to all the files in src/glsl/builtins/ir/, and changes generate_builtins.py so that it no longer globs on '*' to find the files to build. This prevents spurious files (such as EMACS' infamous *~ backup files) from breaking the build.
Diffstat (limited to 'src/glsl/builtins/tools')
-rwxr-xr-xsrc/glsl/builtins/tools/generate_builtins.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
index 8ce2b70c500..b8c12bc3659 100755
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ b/src/glsl/builtins/tools/generate_builtins.py
@@ -24,9 +24,10 @@ compiler = argv[1]
# Read the files in builtins/ir/*...add them to the supplied dictionary.
def read_ir_files(fs):
- for filename in glob(path.join(path.join(builtins_dir, 'ir'), '*')):
+ for filename in glob(path.join(path.join(builtins_dir, 'ir'), '*.ir')):
+ function_name = path.basename(filename).split('.')[0]
with open(filename) as f:
- fs[path.basename(filename)] = f.read()
+ fs[function_name] = f.read()
# Return a dictionary containing all builtin definitions (even generated)
def get_builtin_definitions():
@@ -103,8 +104,13 @@ def write_profiles():
write_profile(filename, profile)
def get_profile_list():
+ profile_files = []
+ for extension in ['frag', 'vert']:
+ path_glob = path.join(
+ path.join(builtins_dir, 'profiles'), '*.' + extension)
+ profile_files.extend(glob(path_glob))
profiles = []
- for pfile in sorted(glob(path.join(path.join(builtins_dir, 'profiles'), '*'))):
+ for pfile in sorted(profile_files):
profiles.append((pfile, path.basename(pfile).replace('.', '_')))
return profiles