{
uint size = parse.FullToken.FullImmediate.Immediate.NrTokens - 1;
assert( size <= 4 );
- assert( mach->ImmLimit + 1 <= TGSI_EXEC_NUM_IMMEDIATES );
+ if (mach->ImmLimit >= mach->ImmsReserved) {
+ unsigned newReserved = mach->ImmsReserved ? 2 * mach->ImmsReserved : 128;
+ float4 *imms = REALLOC(mach->Imms, mach->ImmsReserved, newReserved * sizeof(float4));
+ if (imms) {
+ mach->ImmsReserved = newReserved;
+ mach->Imms = imms;
+ } else {
+ debug_printf("Unable to (re)allocate space for immidiate constants\n");
+ break;
+ }
+ }
for( i = 0; i < size; i++ ) {
mach->Imms[mach->ImmLimit][i] =
if (mach) {
FREE(mach->Instructions);
FREE(mach->Declarations);
+ FREE(mach->Imms);
align_free(mach->Inputs);
align_free(mach->Outputs);
};
#define TGSI_EXEC_NUM_TEMPS 4096
-#define TGSI_EXEC_NUM_IMMEDIATES 256
/*
* Locations of various utility registers (_I = Index, _C = Channel)
#define TGSI_EXEC_MAX_BREAK_STACK (TGSI_EXEC_MAX_LOOP_NESTING + TGSI_EXEC_MAX_SWITCH_NESTING)
+typedef float float4[4];
/**
* Run-time virtual machine state for executing TGSI shader.
struct tgsi_exec_vector Temps[TGSI_EXEC_NUM_TEMPS +
TGSI_EXEC_NUM_TEMP_EXTRAS];
- float Imms[TGSI_EXEC_NUM_IMMEDIATES][4];
-
- float ImmArray[TGSI_EXEC_NUM_IMMEDIATES][4];
+ unsigned ImmsReserved;
+ float4 *Imms;
struct tgsi_exec_vector *Inputs;
struct tgsi_exec_vector *Outputs;