[Mesa-dev] [PATCH v2 5/8] glsl: pass mem_ctx to constant_expression_value(...) and friends

Kenneth Graunke kenneth at whitecape.org
Fri Aug 11 03:37:13 UTC 2017


On Thursday, August 10, 2017 3:42:29 AM PDT Timothy Arceri wrote:
> The main motivation for this is that threaded compilation can fall
> over if we were to allocate IR inside constant_expression_value()
> when calling it on a builtin. This is because builtins are shared
> across the whole OpenGL context.
> 
> f81ede469910d worked around the problem by cloning the entire
> builtin before constant_expression_value() could be called on
> it. However cloning the whole function each time we referenced
> it lead to a significant reduction in the GLSL IR compiler
> performance. This change along with the following patch
> helps fix that performance regression.
> 
> Other advantages are that we reduce the number of calls to
> ralloc_parent(), and for loop unrolling we free constants after
> they are used rather than leaving them hanging around.
> 
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

Looks good to me!  Thanks Tim!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170810/23a5872d/attachment-0001.sig>


More information about the mesa-dev mailing list