[Mesa-dev] [PATCH 2/4] glsl: Emit function signatures at toplevel, even for built-ins.

Kenneth Graunke kenneth at whitecape.org
Fri Aug 5 18:16:22 PDT 2011


On 08/01/2011 04:07 PM, Paul Berry wrote:
> The ast-to-hir conversion needs to emit function signatures in two
> circumstances: when a function declaration (or definition) is
> encountered, and when a built-in function is encountered.
> 
> To avoid emitting a function signature in an illegal place (such as
> inside a function), emit_function() checked whether we were inside a
> function definition, and if so, emitted the signature before the
> function definition.
> 
> However, this didn't cover the case of emitting function signatures
> for built-in functions when those built-in functions are called from
> global scope (e.g. a built-in function called from inside the constant
> integer expression that specifies the length of an array).
> 
> This patch changes emit_function() so that it emits function
> signatures at toplevel in all cases.

Really glad to see that const_cast crap die.  It was always really ugly.

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




More information about the mesa-dev mailing list