[Mesa-dev] [PATCH 1/5] glsl: Don't apply optimization passes to builtins.

Kenneth Graunke kenneth at whitecape.org
Wed Apr 11 10:59:59 PDT 2012


On 03/26/2012 01:59 PM, Eric Anholt wrote:
> The builtins we have are generally optimized, having been
> hand-written.  This avoids generating bad code when an optimization
> pass prints debug output.

*laughs*.  You'd think, but...we actually only run the compiler on the 
*prototypes*, not any actual code!  So running optimization passes is 
completely 100% pointless.

I've been thinking of reworking this now that we have ir_builder.  But 
then again, I'm always threatening to rework this, so...

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

> ---
>   src/glsl/builtins/tools/generate_builtins.py |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
> index 0d97140..f58196f 100755
> --- a/src/glsl/builtins/tools/generate_builtins.py
> +++ b/src/glsl/builtins/tools/generate_builtins.py
> @@ -59,7 +59,7 @@ def write_function_definitions():
>           print stringify(v), ';'
>
>   def run_compiler(args):
> -    command = [compiler, '--dump-lir'] + args
> +    command = [compiler, '--dump-hir'] + args
>       p = Popen(command, 1, stdout=PIPE, shell=False)
>       output = p.communicate()[0]



More information about the mesa-dev mailing list