[Mesa-dev] [PATCH] glsl2: performance regression with import_prototypes

Eric Anholt eric at anholt.net
Wed Aug 4 14:48:50 PDT 2010


On Wed, 4 Aug 2010 16:51:22 +0200, Aras Pranckevicius <aras at unity3d.com> wrote:
> Hi,
> 
> Attached patch - or alternatively, this github commit:
> http://github.com/aras-p/glsl-optimizer/commit/cb5b9ad7b439eddaedc54147f41727a661d11b21
> -
> fixes GLSL2 performance problems after many shaders are processed.
> 
> When constructing builtin functions, they are put into global memory pool
> (once), and their prototypes cloned into current shader. However, the cloned
> prototype variables were still using the global memory pool, which then
> makes talloc_parent's O(N) complexity really visible after a while.

We were talking about this this morning, and I ended up doing a more
complete fix -- most places we clone we want to be cloning into a
particular place, so just pass a mem_ctx in to ->clone().  Looks like
it's fixed the performance problem here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100804/07190155/attachment.pgp>


More information about the mesa-dev mailing list