On 04/18/2012 06:40 PM, Eric Anholt wrote:
This takes advantage of the builtin compiler to generate IR into a string, the same way we read GLSL for function prototypes for our profiles. --- src/glsl/builtins/tools/generate_builtins.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py index fb9052b..eada4a6 100755 --- a/src/glsl/builtins/tools/generate_builtins.py +++ b/src/glsl/builtins/tools/generate_builtins.py @@ -29,11 +29,23 @@ def read_ir_files(fs): with open(filename) as f: fs[function_name] = f.read() +def read_glsl_files(fs): + for filename in glob(path.join(path.join(builtins_dir, 'glsl'), '*.glsl')):
This looks good to me. My original patch to do this was similar, though it detected IR vs. GLSL by looking for a '(' character. That was before Paul made us use file extensions. This is much simpler.
For patches 1-3: Reviewed-by: Kenneth Graunke <[email protected]> For patch 4: Acked-by: Kenneth Graunke <[email protected]> I'm not planning on reviewing the math unless you ask. _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
