diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2020-11-19 10:26:44 -0600 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2020-12-01 16:19:14 -0600 |
commit | 6992d2f625baa460c81a00df2af062851c8c43a7 (patch) | |
tree | 23185eed3f3fa9d212d0cec6ad3d014c6c003a37 | |
parent | 4a7f0aa2e034c7f82cb143367efadb0e3eeca08e (diff) |
intel/fs: Emit HALT_TARGET in emit_nir_code()
Instead of making it a fragment-specific thing based on uses_kill, track
whether or not we need one in fs_visitor and emit HALT_TARGET at the end
of emit_nir_code() if needed.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5071>
-rw-r--r-- | src/intel/compiler/brw_fs.cpp | 14 | ||||
-rw-r--r-- | src/intel/compiler/brw_fs_nir.cpp | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 87dd28f23cc..3420028cb60 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -7960,13 +7960,10 @@ fs_visitor::fixup_3src_null_dest() static const fs_inst * find_halt_control_flow_region_start(const fs_visitor *v) { - if (v->stage == MESA_SHADER_FRAGMENT && - brw_wm_prog_data(v->prog_data)->uses_kill) { - foreach_block_and_inst(block, fs_inst, inst, v->cfg) { - if (inst->opcode == BRW_OPCODE_HALT || - inst->opcode == SHADER_OPCODE_HALT_TARGET) - return inst; - } + foreach_block_and_inst(block, fs_inst, inst, v->cfg) { + if (inst->opcode == BRW_OPCODE_HALT || + inst->opcode == SHADER_OPCODE_HALT_TARGET) + return inst; } return NULL; @@ -8539,9 +8536,6 @@ fs_visitor::run_fs(bool allow_spilling, bool do_rep_send) if (failed) return false; - if (wm_prog_data->uses_kill) - bld.emit(SHADER_OPCODE_HALT_TARGET); - if (wm_key->alpha_test_func) emit_alpha_test(); diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 2de1a4c9acb..108d778cae9 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -46,6 +46,8 @@ fs_visitor::emit_nir_code() last_scratch = ALIGN(nir->scratch_size, 4) * dispatch_width; nir_emit_impl(nir_shader_get_entrypoint((nir_shader *)nir)); + + bld.emit(SHADER_OPCODE_HALT_TARGET); } void |