#include "util/u_math.h"
#include "instr-a3xx.h"
-#include "ir3_compiler.h"
+#include "ir3_shader.h"
/* simple allocator to carve allocations out of an up-front allocated heap,
* so that we can free everything easily in one shot.
return rzalloc_size(shader, sz); /* TODO: don't use rzalloc */
}
-struct ir3 * ir3_create(struct ir3_compiler *compiler, gl_shader_stage type)
+struct ir3 * ir3_create(struct ir3_compiler *compiler,
+ struct ir3_shader_variant *v)
{
- struct ir3 *shader = rzalloc(NULL, struct ir3);
+ struct ir3 *shader = rzalloc(v, struct ir3);
shader->compiler = compiler;
- shader->type = type;
+ shader->type = v->type;
list_inithead(&shader->block_list);
list_inithead(&shader->array_list);
if (instr->flags & IR3_INSTR_S2EN) {
struct ir3_register *samp_tex = instr->regs[1];
- iassert(samp_tex->flags & IR3_REG_HALF);
cat5->s2en_bindless.src3 = reg(samp_tex, info, instr->repeat,
(instr->flags & IR3_INSTR_B) ? 0 : IR3_REG_HALF);
if (instr->flags & IR3_INSTR_B) {
}
} else {
cat6c->off = instr->cat6.dst_offset;
+ cat6c->off_high = instr->cat6.dst_offset >> 8;
}
} else {
instr_cat6d_t *cat6d = ptr;
info->sizedwords = align(info->sizedwords, 4 * 2);
}
- ptr = dwords = calloc(4, info->sizedwords);
+ ptr = dwords = rzalloc_size(v, 4 * info->sizedwords);
foreach_block (block, &shader->block_list) {
unsigned sfu_delay = 0;