diff options
author | Frank Henigman <[email protected]> | 2013-10-01 15:15:43 -0400 |
---|---|---|
committer | José Fonseca <[email protected]> | 2014-05-14 11:05:00 +0100 |
commit | ef14f0d59f24ab506b50d7612368381df51d515c (patch) | |
tree | f97b5556d104e1ffe45d24c58296b8ca5682d88e | |
parent | 865d0312c0dd7411ce813206cef3c399d6641241 (diff) |
draw: Delete unneeded LLVM stuff earlier.
Free up unneeded LLVM stuff immediately after generating vertex shader
code. Saves about 500K per shader.
v2: Don't bother calling gallivm_free_function (Jose)
Signed-off-by: José Fonseca <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 6a3e5b239dc..7ecc34062b0 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -555,6 +555,8 @@ draw_llvm_create_variant(struct draw_llvm *llvm, variant->jit_func_elts = (draw_jit_vert_func_elts) gallivm_jit_function(variant->gallivm, variant->function_elts); + gallivm_free_ir(variant->gallivm); + variant->shader = shader; variant->list_item_global.base = variant; variant->list_item_local.base = variant; @@ -1960,16 +1962,6 @@ draw_llvm_destroy_variant(struct draw_llvm_variant *variant) { struct draw_llvm *llvm = variant->llvm; - if (variant->function_elts) { - gallivm_free_function(variant->gallivm, - variant->function_elts, variant->jit_func_elts); - } - - if (variant->function) { - gallivm_free_function(variant->gallivm, - variant->function, variant->jit_func); - } - gallivm_destroy(variant->gallivm); remove_from_list(&variant->list_item_local); @@ -2206,6 +2198,8 @@ draw_gs_llvm_create_variant(struct draw_llvm *llvm, variant->jit_func = (draw_gs_jit_func) gallivm_jit_function(variant->gallivm, variant->function); + gallivm_free_ir(variant->gallivm); + variant->list_item_global.base = variant; variant->list_item_local.base = variant; /*variant->no = */shader->variants_created++; @@ -2219,11 +2213,6 @@ draw_gs_llvm_destroy_variant(struct draw_gs_llvm_variant *variant) { struct draw_llvm *llvm = variant->llvm; - if (variant->function) { - gallivm_free_function(variant->gallivm, - variant->function, variant->jit_func); - } - gallivm_destroy(variant->gallivm); remove_from_list(&variant->list_item_local); |