diff options
author | Keith Whitwell <[email protected]> | 2009-07-16 00:23:33 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-07-16 09:53:08 +0100 |
commit | 4e3002b50fcedf3a6db1ac7394077bc3337ccda1 (patch) | |
tree | 0ba1303ec6887426280bcb63730ea9afc27c0376 /src/gallium/auxiliary/tgsi/tgsi_exec.c | |
parent | c202fe187cf7a08d60e23ce617a5820a8bc510fd (diff) |
tgsi: no need to separately malloc input and output arrays
Can now guarantee alignment in the initial allocation of the tgsi exec machine.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_exec.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index d9ebd955c82..fe571a86bca 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -379,24 +379,12 @@ tgsi_exec_machine_create( void ) mach->Samplers = NULL; mach->Consts = NULL; - mach->Inputs = NULL; - mach->Outputs = NULL; mach->Tokens = NULL; mach->Primitives = NULL; mach->InterpCoefs = NULL; mach->Instructions = NULL; mach->Declarations = NULL; - mach->Inputs = align_malloc(PIPE_MAX_ATTRIBS * - sizeof(struct tgsi_exec_vector), 16); - if (!mach->Inputs) - goto fail; - - mach->Outputs = align_malloc(PIPE_MAX_ATTRIBS * - sizeof(struct tgsi_exec_vector), 16); - if (!mach->Outputs) - goto fail; - /* Setup constants. */ for( i = 0; i < 4; i++ ) { mach->Temps[TEMP_0_I].xyzw[TEMP_0_C].u[i] = 0x00000000; @@ -420,12 +408,7 @@ tgsi_exec_machine_create( void ) return mach; fail: - if (mach) { - align_free(mach->Inputs); - align_free(mach->Outputs); - align_free(mach); - } - + align_free(mach); return NULL; } @@ -433,16 +416,11 @@ fail: void tgsi_exec_machine_destroy(struct tgsi_exec_machine *mach) { - if (mach->Instructions) { + if (mach) { FREE(mach->Instructions); - mach->Instructions = NULL; - mach->NumInstructions = 0; - } - if (mach->Declarations) { FREE(mach->Declarations); - mach->Declarations = NULL; - mach->NumDeclarations = 0; } + align_free(mach); } |