From 21b0dbd79937e9d6787f045af7d60d4b6c649ec8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Jul 2010 16:47:25 -0700 Subject: 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/glsl_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glsl/glsl_types.h') diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index e869071cab..8ba9b5ff63 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -136,7 +136,7 @@ struct glsl_type { union { const struct glsl_type *array; /**< Type of array elements. */ const struct glsl_type *parameters; /**< Parameters to function. */ - const struct glsl_struct_field *structure;/**< List of struct fields. */ + struct glsl_struct_field *structure; /**< List of struct fields. */ } fields; -- cgit v1.2.3