[Mesa-dev] [PATCH 25/26] glsl: Keep common variable names in static storage

Matt Turner mattst88 at gmail.com
Fri Jul 18 16:49:37 PDT 2014


On Mon, Jul 14, 2014 at 3:48 PM, Ian Romanick <idr at freedesktop.org> wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Valgrind massif results for a trimmed apitrace of dota2:
>
>                   n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
> Before (32-bit): 52 40,521,071,734       66,157,928       61,054,870     5,103,058            0
> After  (32-bit): 79 40,523,892,028       65,999,288       60,937,396     5,061,892            0
>
> Before (64-bit): 48 37,089,379,412       92,630,712       85,454,539     7,176,173            0
> After  (64-bit): 71 37,091,183,117       92,433,072       85,309,100     7,123,972            0
>
> A real savings of 114KiB on 32-bit and 142KiB on 64-bit.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/glsl/.gitignore               |   1 +
>  src/glsl/Makefile.am              |  10 ++
>  src/glsl/common_variable_names.py | 220 ++++++++++++++++++++++++++++++++++++++
>  src/glsl/ir.cpp                   |  32 ++++--
>  src/glsl/ir.h                     |   9 +-
>  5 files changed, 256 insertions(+), 16 deletions(-)
>  create mode 100644 src/glsl/common_variable_names.py
>
> diff --git a/src/glsl/.gitignore b/src/glsl/.gitignore
> index 43720f6..16e7e81 100644
> --- a/src/glsl/.gitignore
> +++ b/src/glsl/.gitignore
> @@ -1,3 +1,4 @@
> +get_static_name.h
>  glsl_compiler
>  glsl_lexer.cpp
>  glsl_parser.cpp
> diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
> index 00261fd..c9de9f8 100644
> --- a/src/glsl/Makefile.am
> +++ b/src/glsl/Makefile.am
> @@ -149,6 +149,15 @@ glsl_test_SOURCES = \
>
>  glsl_test_LDADD = libglsl.la
>
> +# I don't understand why automake recognizes that glsl_parser_extras.lo
> +# depends on glsl_parser.h, but it cannot recognize that ir.lo depends on
> +# get_static_name.h.
> +
> +ir.lo: get_static_name.h

Rather than this, you should just list get_static_name.h in
BUILT_SOURCES below. (BUILT_SOURCES are created before anything else
in the directory happens)


More information about the mesa-dev mailing list