diff options
author | Ian Romanick <[email protected]> | 2014-07-14 15:48:34 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-08-04 15:48:09 -0700 |
commit | 7b1898314709e3e70571c491f7f62745c05e13e1 (patch) | |
tree | 6c0256572d9bb20d98a69aea1b11eb9b9c83e724 /src/mesa/main/drawtex.h | |
parent | 3d051772c8ef0f14f5ab3ccd954b5b3bb65e6ba7 (diff) |
glsl: Rebuild the symbol table without unreachable symbols
Previously we had to keep unreachable global symbols in the symbol table
because the symbol table is used during linking. Having the symbol
table retain pointers to freed memory... what could possibly go wrong?
At the same time, this meant that we kept live references to tons of
memory that was no longer needed.
New strategy: destroy the old symbol table, and make a new one from the
reachable symbols.
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): 59 40,642,425,451 76,337,968 69,720,886 6,617,082 0
After (32-bit): 46 40,661,487,174 75,116,800 68,854,065 6,262,735 0
Before (64-bit): 79 37,179,441,771 106,986,512 98,112,095 8,874,417 0
After (64-bit): 64 37,200,329,700 104,872,672 96,514,546 8,358,126 0
A real savings of 846KiB on 32-bit and 1.5MiB on 64-bit.
v2: (by Kenneth Graunke) Just add the ir_function from the IR stream,
rather than looking it up in the symbol table; they're now
identical.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/drawtex.h')
0 files changed, 0 insertions, 0 deletions