[Mesa-dev] [PATCH 3/4] glsl: Add support for generating builtin code from GLSL instead of IR.

Kenneth Graunke kenneth at whitecape.org
Wed Apr 18 19:05:03 PDT 2012


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 <kenneth at whitecape.org>

For patch 4:
Acked-by: Kenneth Graunke <kenneth at whitecape.org>

I'm not planning on reviewing the math unless you ask.


More information about the mesa-dev mailing list