From eba2e044a04da99fea2214ba10ca5981f596702e Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 24 Dec 2007 17:37:59 -0700 Subject: [PATCH] added tgsi_exec_machine_free_data() --- src/mesa/pipe/tgsi/exec/tgsi_exec.c | 16 ++++++++++++++++ src/mesa/pipe/tgsi/exec/tgsi_exec.h | 5 +++++ 2 files changed, 21 insertions(+) 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 -- 2.30.2