typedef std::stack<region_node*> region_stack;
region_stack loop_stack;
+ bool gpr_reladdr;
+
public:
bc_parser(sb_context &sctx, r600_bytecode *bc, r600_shader* pshader) :
ctx(sctx), dec(), bc(bc), pshader(pshader),
dw(), bc_ndw(), max_cf(),
sh(), error(), slots(), cgroup(),
- cf_map(), loop_stack() { }
+ cf_map(), loop_stack(), gpr_reladdr() { }
int decode();
int prepare();
int bc_parser::parse_decls() {
if (!pshader) {
- sh->add_gpr_array(0, bc->ngpr, 0x0F);
+ if (gpr_reladdr)
+ sh->add_gpr_array(0, bc->ngpr, 0x0F);
return 0;
}
if ((r = decode_fetch_clause(cf)))
return r;;
} else if (flags & CF_EXP) {
+ if (cf->bc.rw_rel)
+ gpr_reladdr = true;
assert(!cf->bc.rw_rel);
} else if (flags & (CF_STRM | CF_RAT)) {
+ if (cf->bc.rw_rel)
+ gpr_reladdr = true;
assert(!cf->bc.rw_rel);
} else if (flags & CF_BRANCH) {
if (cf->bc.addr > max_cf)
for (node_iterator I = g->begin(), E = g->end(); I != E; ++I) {
n = static_cast<alu_node*>(*I);
+ if (n->bc.dst_rel)
+ gpr_reladdr = true;
+
for (int k = 0; k < n->bc.op_ptr->src_count; ++k) {
bc_alu_src &src = n->bc.src[k];
+ if (src.rel)
+ gpr_reladdr = true;
if (src.sel == ALU_SRC_LITERAL) {
literal_mask |= (1 << src.chan);
src.value.u = dw[i + src.chan];
cf->push_back(n);
if ((r = dec->decode_fetch(i, n->bc)))
return r;
+ if (n->bc.src_rel || n->bc.dst_rel)
+ gpr_reladdr = true;
}
return 0;