summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2020-01-20 17:40:13 +0000
committerMarge Bot <[email protected]>2020-01-29 18:02:27 +0000
commitdb19e96c8c63ee266fee37d3eb634b0ca30a28ab (patch)
treebc845f2fcc04e335cb0b7bae549bbb395e46953b /src
parentc7d05141686ecd6266683f11fb5423b6545c49a4 (diff)
aco: fix exec mask consistency issues
There seems to be more, these are just the ones found in Detroit: Become Human shaders. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3257> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3257>
Diffstat (limited to 'src')
-rw-r--r--src/amd/compiler/aco_insert_exec_mask.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp
index 44da289339b..37a994cd4df 100644
--- a/src/amd/compiler/aco_insert_exec_mask.cpp
+++ b/src/amd/compiler/aco_insert_exec_mask.cpp
@@ -968,10 +968,14 @@ void add_branch_code(exec_ctx& ctx, Block* block)
assert(block->instructions.back()->opcode == aco_opcode::p_branch);
block->instructions.pop_back();
- while (!(ctx.info[idx].exec.back().second & mask_type_loop))
+ bool need_parallelcopy = false;
+ while (!(ctx.info[idx].exec.back().second & mask_type_loop)) {
ctx.info[idx].exec.pop_back();
+ need_parallelcopy = true;
+ }
- ctx.info[idx].exec.back().first = bld.pseudo(aco_opcode::p_parallelcopy, bld.def(bld.lm, exec), ctx.info[idx].exec.back().first);
+ if (need_parallelcopy)
+ ctx.info[idx].exec.back().first = bld.pseudo(aco_opcode::p_parallelcopy, bld.def(bld.lm, exec), ctx.info[idx].exec.back().first);
bld.branch(aco_opcode::p_cbranch_nz, bld.exec(ctx.info[idx].exec.back().first), block->linear_succs[1], block->linear_succs[0]);
return;
}
@@ -1052,7 +1056,7 @@ void add_branch_code(exec_ctx& ctx, Block* block)
cond = bld.tmp(s1);
Temp exec_mask = ctx.info[idx].exec[exec_idx].first;
exec_mask = bld.sop2(Builder::s_andn2, bld.def(bld.lm), bld.scc(Definition(cond)),
- exec_mask, current_exec);
+ exec_mask, bld.exec(current_exec));
ctx.info[idx].exec[exec_idx].first = exec_mask;
if (ctx.info[idx].exec[exec_idx].second & mask_type_loop)
break;