return true;
}
-void shader::add_gpr_values(vvec& vec, unsigned gpr, unsigned comp_mask,
+void shader::add_pinned_gpr_values(vvec& vec, unsigned gpr, unsigned comp_mask,
bool src) {
unsigned chan = 0;
while (comp_mask) {
v->gpr = v->pin_gpr = v->select;
v->fix();
}
+ if (v->array && !v->array->gpr) {
+ // if pinned value can be accessed with indirect addressing
+ // pin the entire array to its original location
+ v->array->gpr = v->array->base_gpr;
+ }
vec.push_back(v);
}
comp_mask >>= 1;
i.comp_mask = comp_mask;
if (preloaded) {
- add_gpr_values(root->dst, gpr, comp_mask, true);
+ add_pinned_gpr_values(root->dst, gpr, comp_mask, true);
}
}
for(inputs_vec::const_iterator I = inputs.begin(),
E = inputs.end(); I != E; ++I, ++gpr) {
if (!I->preloaded)
- add_gpr_values(cf->dst, gpr, I->comp_mask, false);
+ add_pinned_gpr_values(cf->dst, gpr, I->comp_mask, false);
else
- add_gpr_values(cf->src, gpr, I->comp_mask, true);
+ add_pinned_gpr_values(cf->src, gpr, I->comp_mask, true);
}
}
value* get_value_version(value* v, unsigned ver);
void init();
- void add_gpr_values(vvec& vec, unsigned gpr, unsigned comp_mask, bool src);
+ void add_pinned_gpr_values(vvec& vec, unsigned gpr, unsigned comp_mask, bool src);
void dump_ir();