mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-05 01:40:35 +02:00
tgsi: no need to separately malloc input and output arrays
Can now guarantee alignment in the initial allocation of the tgsi exec machine.
This commit is contained in:
parent
c202fe187c
commit
4e3002b50f
2 changed files with 6 additions and 27 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -198,14 +198,15 @@ struct tgsi_exec_machine
|
|||
|
||||
float Imms[TGSI_EXEC_NUM_IMMEDIATES][4];
|
||||
|
||||
struct tgsi_exec_vector Inputs[PIPE_MAX_ATTRIBS];
|
||||
struct tgsi_exec_vector Outputs[PIPE_MAX_ATTRIBS];
|
||||
|
||||
struct tgsi_exec_vector *Addrs;
|
||||
|
||||
struct tgsi_sampler **Samplers;
|
||||
|
||||
unsigned ImmLimit;
|
||||
const float (*Consts)[4];
|
||||
struct tgsi_exec_vector *Inputs;
|
||||
struct tgsi_exec_vector *Outputs;
|
||||
const struct tgsi_token *Tokens; /**< Declarations, instructions */
|
||||
unsigned Processor; /**< TGSI_PROCESSOR_x */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue