[Mesa-dev] [PATCH 1/2] glsl: reduce size of glsl_type::base_type

Ian Romanick idr at freedesktop.org
Wed May 28 10:11:07 PDT 2014


Types are fly-weights, so there aren't that many of them allocated...
maybe a couple hundred, tops.  Have you measured the memory savings?

On 05/27/2014 10:09 PM, Tapani Pälli wrote:
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/glsl/glsl_types.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
> index dca5492..e6aae26a 100644
> --- a/src/glsl/glsl_types.h
> +++ b/src/glsl/glsl_types.h
> @@ -29,6 +29,7 @@
>  #include <string.h>
>  #include <assert.h>
>  #include "main/mtypes.h" /* for gl_texture_index, C++'s enum rules are broken */
> +#include "main/compiler.h"
>  
>  #ifdef __cplusplus
>  extern "C" {
> @@ -47,7 +48,7 @@ _mesa_glsl_release_types(void);
>  }
>  #endif
>  
> -enum glsl_base_type {
> +enum PACKED glsl_base_type {
>     GLSL_TYPE_UINT = 0,
>     GLSL_TYPE_INT,
>     GLSL_TYPE_FLOAT,
> 



More information about the mesa-dev mailing list