Module: Mesa Branch: main Commit: b35f1fc910b9c362623f4f47fe43bcd5cfcb3d21 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b35f1fc910b9c362623f4f47fe43bcd5cfcb3d21
Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Nov 23 01:04:00 2022 -0800 intel/compiler: Delete unused emit_dummy_fs() This code is compiled out, but has been left in place in case we wanted to use it for debugging something. In the olden days, we'd use it for platform enabling. I can't think of the last time we did that, though. I also used to use it for debugging. If something was misrendering, I'd iterate through shaders 0..N, replacing them with "draw hot pink" until whatever shader was drawing the bad stuff was brightly illuminated. Once it was identified, I'd start investigating that shader. These days, we have frameretrace and renderdoc which are like, actual tools that let you highlight draws and replace shaders. So we don't need to resort iterative driver hacks anymore. Again, I can't think of the last time I actually did that. So, this code is basically just dead. And it's using legacy MRF paths, which we could update...or we could just delete it. Reviewed-by: Caio Oliveira <caio.olive...@intel.com> Reviewed-by: Emma Anholt <e...@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172> --- src/intel/compiler/brw_fs.cpp | 4 +-- src/intel/compiler/brw_fs.h | 1 - src/intel/compiler/brw_fs_visitor.cpp | 46 ----------------------------------- 3 files changed, 1 insertion(+), 50 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index db67b332576..8199cfbe9a9 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -7266,9 +7266,7 @@ fs_visitor::run_fs(bool allow_spilling, bool do_rep_send) payload_ = new fs_thread_payload(*this, source_depth_to_render_target, runtime_check_aads_emit); - if (0) { - emit_dummy_fs(); - } else if (do_rep_send) { + if (do_rep_send) { assert(dispatch_width == 16); emit_repclear_shader(); } else { diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index 778853fa0cf..f22af018684 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -303,7 +303,6 @@ public: bool lower_sub_sat(); bool opt_combine_constants(); - void emit_dummy_fs(); void emit_repclear_shader(); void emit_fragcoord_interpolation(fs_reg wpos); void emit_is_helper_invocation(fs_reg result); diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp index 6e2c4a31e24..c9d4c099827 100644 --- a/src/intel/compiler/brw_fs_visitor.cpp +++ b/src/intel/compiler/brw_fs_visitor.cpp @@ -62,52 +62,6 @@ fs_visitor::emit_mcs_fetch(const fs_reg &coordinate, unsigned components, return dest; } -/** Emits a dummy fragment shader consisting of magenta for bringup purposes. */ -void -fs_visitor::emit_dummy_fs() -{ - int reg_width = dispatch_width / 8; - - /* Everyone's favorite color. */ - const float color[4] = { 1.0, 0.0, 1.0, 0.0 }; - for (int i = 0; i < 4; i++) { - bld.MOV(fs_reg(MRF, 2 + i * reg_width, BRW_REGISTER_TYPE_F), - brw_imm_f(color[i])); - } - - fs_inst *write; - write = bld.emit(FS_OPCODE_FB_WRITE); - write->eot = true; - write->last_rt = true; - if (devinfo->ver >= 6) { - write->base_mrf = 2; - write->mlen = 4 * reg_width; - } else { - write->header_size = 2; - write->base_mrf = 0; - write->mlen = 2 + 4 * reg_width; - } - - /* Tell the SF we don't have any inputs. Gfx4-5 require at least one - * varying to avoid GPU hangs, so set that. - */ - struct brw_wm_prog_data *wm_prog_data = brw_wm_prog_data(this->prog_data); - wm_prog_data->num_varying_inputs = devinfo->ver < 6 ? 1 : 0; - memset(wm_prog_data->urb_setup, -1, - sizeof(wm_prog_data->urb_setup[0]) * VARYING_SLOT_MAX); - brw_compute_urb_setup_index(wm_prog_data); - - /* We don't have any uniforms. */ - stage_prog_data->nr_params = 0; - stage_prog_data->curb_read_length = 0; - stage_prog_data->dispatch_grf_start_reg = 2; - wm_prog_data->dispatch_grf_start_reg_16 = 2; - wm_prog_data->dispatch_grf_start_reg_32 = 2; - grf_used = 1; /* Gfx4-5 don't allow zero GRF blocks */ - - calculate_cfg(); -} - /* Input data is organized with first the per-primitive values, followed * by per-vertex values. The per-vertex will have interpolation information * associated, so use 4 components for each value.