}
if (can_swizzle) {
- struct swizzled_imms* si =
- &ttr->imms_to_swizzle[ttr->imms_to_swizzle_count];
-
- si->index = index;
- si->swizzle = swizzle;
+ ttr->imms_to_swizzle[ttr->imms_to_swizzle_count].index = index;
+ ttr->imms_to_swizzle[ttr->imms_to_swizzle_count].swizzle = swizzle;
ttr->imms_to_swizzle_count++;
} else {
constant.Type = RC_CONSTANT_IMMEDIATE;
ttr->immediate_offset = ttr->compiler->Program.Constants.Count;
+ ttr->imms_to_swizzle = malloc(ttr->info->immediate_count * sizeof(struct swizzled_imms));
+ ttr->imms_to_swizzle_count = 0;
+
tgsi_parse_init(&parser, tokens);
while (!tgsi_parse_end_of_tokens(&parser)) {
tgsi_parse_free(&parser);
+ free(ttr->imms_to_swizzle);
+
rc_calculate_inputs_outputs(ttr->compiler);
}
const struct tgsi_shader_info * info;
int immediate_offset;
- struct swizzled_imms imms_to_swizzle[10];
+ struct swizzled_imms * imms_to_swizzle;
unsigned imms_to_swizzle_count;
};