diff options
author | Jason Ekstrand <[email protected]> | 2014-12-12 20:37:04 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-01-15 07:20:21 -0800 |
commit | b3fd098e7daa491637d66d03366b67c989937a1f (patch) | |
tree | 000f2453d4fe1d914008a484811c1c672589d3c8 /src/mesa/drivers/dri | |
parent | 295faf9462cba88250d8581f65611996eba5e389 (diff) |
nir: Make bcsel a fully vector operation
Previously, the condition was a scalar that applied to all components
simultaneously. As of this commit, the condition is a vector and each
component is switched seperately.
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 9eece0170c1..266781bff3b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -965,9 +965,14 @@ fs_visitor::nir_emit_alu(nir_alu_instr *instr) break; case nir_op_bcsel: - emit(CMP(reg_null_d, op[0], fs_reg(0), BRW_CONDITIONAL_NZ)); - emit_percomp(BRW_OPCODE_SEL, result, op[1], op[2], - instr->dest.write_mask, false, BRW_PREDICATE_NORMAL); + for (unsigned i = 0; i < 4; i++) { + if (!((instr->dest.write_mask >> i) & 1)) + continue; + + emit(CMP(reg_null_d, offset(op[0], i), fs_reg(0), BRW_CONDITIONAL_NZ)); + emit(SEL(offset(result, i), offset(op[1], i), offset(op[2], i))) + ->predicate = BRW_PREDICATE_NORMAL; + } break; default: |