mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-26 20:00:32 +01:00
intel/compiler: Create and use nir_to_brw() function
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
This commit is contained in:
parent
38a42e5aa1
commit
4e5fcccd01
3 changed files with 18 additions and 19 deletions
|
|
@ -6661,7 +6661,7 @@ fs_visitor::run_vs()
|
|||
|
||||
payload_ = new vs_thread_payload(*this);
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
|
@ -6787,7 +6787,7 @@ fs_visitor::run_tcs()
|
|||
bld.IF(BRW_PREDICATE_NORMAL);
|
||||
}
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (fix_dispatch_mask) {
|
||||
bld.emit(BRW_OPCODE_ENDIF);
|
||||
|
|
@ -6823,7 +6823,7 @@ fs_visitor::run_tes()
|
|||
|
||||
payload_ = new tes_thread_payload(*this);
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
|
@ -6872,7 +6872,7 @@ fs_visitor::run_gs()
|
|||
}
|
||||
}
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
emit_gs_thread_end();
|
||||
|
||||
|
|
@ -6967,7 +6967,7 @@ fs_visitor::run_fs(bool allow_spilling, bool do_rep_send)
|
|||
if (nir->info.writes_memory)
|
||||
wm_prog_data->has_side_effects = true;
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
|
@ -7016,7 +7016,7 @@ fs_visitor::run_cs(bool allow_spilling)
|
|||
suboffset(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW), 1));
|
||||
}
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
|
@ -7047,7 +7047,7 @@ fs_visitor::run_bs(bool allow_spilling)
|
|||
|
||||
payload_ = new bs_thread_payload(*this);
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
|
@ -7079,7 +7079,7 @@ fs_visitor::run_task(bool allow_spilling)
|
|||
|
||||
payload_ = new task_mesh_thread_payload(*this);
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
|
@ -7112,7 +7112,7 @@ fs_visitor::run_mesh(bool allow_spilling)
|
|||
|
||||
payload_ = new task_mesh_thread_payload(*this);
|
||||
|
||||
emit_nir_code();
|
||||
nir_to_brw(this);
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -308,8 +308,6 @@ public:
|
|||
|
||||
void set_tcs_invocation_id();
|
||||
|
||||
void emit_nir_code();
|
||||
|
||||
void emit_alpha_test();
|
||||
fs_inst *emit_single_fb_write(const brw::fs_builder &bld,
|
||||
fs_reg color1, fs_reg color2,
|
||||
|
|
@ -615,5 +613,6 @@ void brw_emit_predicate_on_sample_mask(const brw::fs_builder &bld, fs_inst *inst
|
|||
int brw_get_subgroup_id_param_index(const intel_device_info *devinfo,
|
||||
const brw_stage_prog_data *prog_data);
|
||||
|
||||
void nir_to_brw(fs_visitor *s);
|
||||
|
||||
#endif /* BRW_FS_H */
|
||||
|
|
|
|||
|
|
@ -8464,13 +8464,13 @@ emit_shader_float_controls_execution_mode(nir_to_brw_state *ntb)
|
|||
}
|
||||
|
||||
void
|
||||
fs_visitor::emit_nir_code()
|
||||
nir_to_brw(fs_visitor *s)
|
||||
{
|
||||
nir_to_brw_state *ntb = rzalloc(NULL, nir_to_brw_state);
|
||||
ntb->s = this;
|
||||
ntb->devinfo = devinfo;
|
||||
ntb->nir = nir;
|
||||
ntb->bld = fs_builder(this).at_end();
|
||||
ntb->s = s;
|
||||
ntb->devinfo = s->devinfo;
|
||||
ntb->nir = s->nir;
|
||||
ntb->bld = fs_builder(s).at_end();
|
||||
|
||||
emit_shader_float_controls_execution_mode(ntb);
|
||||
|
||||
|
|
@ -8478,11 +8478,11 @@ fs_visitor::emit_nir_code()
|
|||
* be converted to reads/writes of these arrays
|
||||
*/
|
||||
fs_nir_setup_outputs(ntb);
|
||||
fs_nir_setup_uniforms(this);
|
||||
fs_nir_setup_uniforms(s);
|
||||
fs_nir_emit_system_values(ntb);
|
||||
last_scratch = ALIGN(nir->scratch_size, 4) * dispatch_width;
|
||||
s->last_scratch = ALIGN(s->nir->scratch_size, 4) * s->dispatch_width;
|
||||
|
||||
fs_nir_emit_impl(ntb, nir_shader_get_entrypoint((nir_shader *)nir));
|
||||
fs_nir_emit_impl(ntb, nir_shader_get_entrypoint((nir_shader *)s->nir));
|
||||
|
||||
ntb->bld.emit(SHADER_OPCODE_HALT_TARGET);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue