From: Brian Date: Tue, 25 Dec 2007 00:37:59 +0000 (-0700) Subject: added tgsi_exec_machine_free_data() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eba2e044a04da99fea2214ba10ca5981f596702e;p=mesa.git added tgsi_exec_machine_free_data() --- diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.c b/src/mesa/pipe/tgsi/exec/tgsi_exec.c index e469281d228..49affc12f35 100644 --- a/src/mesa/pipe/tgsi/exec/tgsi_exec.c +++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.c @@ -275,6 +275,22 @@ tgsi_exec_machine_init( } +void +tgsi_exec_machine_free_data(struct tgsi_exec_machine *mach) +{ + if (mach->Instructions) { + FREE(mach->Instructions); + mach->Instructions = NULL; + mach->NumInstructions = 0; + } + if (mach->Declarations) { + FREE(mach->Declarations); + mach->Declarations = NULL; + mach->NumDeclarations = 0; + } +} + + static void micro_abs( union tgsi_exec_channel *dst, diff --git a/src/mesa/pipe/tgsi/exec/tgsi_exec.h b/src/mesa/pipe/tgsi/exec/tgsi_exec.h index db92e282dfb..1fb66ee960f 100644 --- a/src/mesa/pipe/tgsi/exec/tgsi_exec.h +++ b/src/mesa/pipe/tgsi/exec/tgsi_exec.h @@ -227,6 +227,11 @@ uint tgsi_exec_machine_run( struct tgsi_exec_machine *mach ); + +void +tgsi_exec_machine_free_data(struct tgsi_exec_machine *mach); + + #if defined __cplusplus } /* extern "C" */ #endif