glsl2: talloc the glsl_struct_field[] we use to look up structure types.
authorEric Anholt <eric@anholt.net>
Tue, 20 Jul 2010 23:47:25 +0000 (16:47 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 21 Jul 2010 00:30:10 +0000 (17:30 -0700)
commit21b0dbd79937e9d6787f045af7d60d4b6c649ec8
treeffba1dbb2896d9ab9ddc24a062b69763d55a1826
parentb6e92ad7da9d4f00607caca90bd0b8853623a493
glsl2: talloc the glsl_struct_field[] we use to look up structure types.

Since the types are singletons across the lifetime of the compiler,
repeatedly compiling a program with the same structure type defined
would drop a copy of the array on the floor per compile.

This is a bit tricky because the static GLSL types are not called with
the talloc-based new, so we have to use the global type context, which
may not be initialized yet.
src/glsl/ast_to_hir.cpp
src/glsl/glsl_types.cpp
src/glsl/glsl_types.h