summaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3/ir3_shader.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-04-29 13:12:31 -0700
committerRob Clark <[email protected]>2019-04-30 10:39:24 -0700
commitec6c2297634eba77248a929048cf4201887a5f0a (patch)
treee433954d948445d306c58a90b4af967fc69c4ab9 /src/freedreno/ir3/ir3_shader.c
parentce57f4f7c4d672a88527d0d346e27b902cfc3c6a (diff)
freedreno/ir3: fixes for half reg in/out
Needs to update max_half_reg, or be remapped to full reg and update max_reg accordingly, depending on generation.. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/ir3/ir3_shader.c')
-rw-r--r--src/freedreno/ir3/ir3_shader.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c
index 3f8e8abdc08..46eba2a0c5e 100644
--- a/src/freedreno/ir3/ir3_shader.c
+++ b/src/freedreno/ir3/ir3_shader.c
@@ -63,7 +63,7 @@ delete_variant(struct ir3_shader_variant *v)
* the reg off.
*/
static void
-fixup_regfootprint(struct ir3_shader_variant *v)
+fixup_regfootprint(struct ir3_shader_variant *v, uint32_t gpu_id)
{
unsigned i;
@@ -83,14 +83,30 @@ fixup_regfootprint(struct ir3_shader_variant *v)
if (v->inputs[i].compmask) {
unsigned n = util_last_bit(v->inputs[i].compmask) - 1;
- int32_t regid = (v->inputs[i].regid + n) >> 2;
- v->info.max_reg = MAX2(v->info.max_reg, regid);
+ int32_t regid = v->inputs[i].regid + n;
+ if (v->inputs[i].half) {
+ if (gpu_id < 500) {
+ v->info.max_half_reg = MAX2(v->info.max_half_reg, regid >> 2);
+ } else {
+ v->info.max_reg = MAX2(v->info.max_reg, regid >> 3);
+ }
+ } else {
+ v->info.max_reg = MAX2(v->info.max_reg, regid >> 2);
+ }
}
}
for (i = 0; i < v->outputs_count; i++) {
- int32_t regid = (v->outputs[i].regid + 3) >> 2;
- v->info.max_reg = MAX2(v->info.max_reg, regid);
+ int32_t regid = v->outputs[i].regid + 3;
+ if (v->outputs[i].half) {
+ if (gpu_id < 500) {
+ v->info.max_half_reg = MAX2(v->info.max_half_reg, regid >> 2);
+ } else {
+ v->info.max_reg = MAX2(v->info.max_reg, regid >> 3);
+ }
+ } else {
+ v->info.max_reg = MAX2(v->info.max_reg, regid >> 2);
+ }
}
}
@@ -117,7 +133,7 @@ void * ir3_shader_assemble(struct ir3_shader_variant *v, uint32_t gpu_id)
*/
v->constlen = MIN2(255, MAX2(v->constlen, v->info.max_const + 1));
- fixup_regfootprint(v);
+ fixup_regfootprint(v, gpu_id);
return bin;
}