void radeon_llvm_context_init(struct radeon_llvm_context *ctx,
const char *triple,
- const struct tgsi_shader_info *info);
+ const struct tgsi_shader_info *info,
+ const struct tgsi_token *tokens);
void radeon_llvm_create_func(struct radeon_llvm_context *ctx,
LLVMTypeRef *return_types, unsigned num_return_elems,
if (decl->Declaration.Array) {
unsigned id = decl->Array.ArrayID - 1;
- ctx->temp_arrays[id].range = decl->Range;
-
/* If the array has more than 16 elements, store it
* in memory using an alloca that spans the entire
* array.
}
void radeon_llvm_context_init(struct radeon_llvm_context *ctx, const char *triple,
- const struct tgsi_shader_info *info)
+ const struct tgsi_shader_info *info,
+ const struct tgsi_token *tokens)
{
struct lp_type type;
ctx->temp_arrays = CALLOC(size, sizeof(ctx->temp_arrays[0]));
ctx->temp_array_allocas = CALLOC(size, sizeof(ctx->temp_array_allocas[0]));
+
+ if (tokens)
+ tgsi_scan_arrays(tokens, TGSI_FILE_TEMPORARY, size,
+ ctx->temp_arrays);
}
type.floating = true;
memset(ctx, 0, sizeof(*ctx));
radeon_llvm_context_init(
&ctx->radeon_bld, "amdgcn--",
- (shader && shader->selector) ? &shader->selector->info : NULL);
+ (shader && shader->selector) ? &shader->selector->info : NULL,
+ (shader && shader->selector) ? shader->selector->tokens : NULL);
ctx->tm = tm;
ctx->screen = sscreen;
if (shader && shader->selector)