mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
brw: populate wm_prog_data earlier
So that we can put the coarse_pixel_dispatch value available to NIR lowering. LNL internal fossildb changes: Totals from 40 (0.01% of 490838) affected shaders: Instrs: 33321 -> 33311 (-0.03%); split: -0.04%, +0.01% Cycle count: 780136 -> 779936 (-0.03%); split: -0.03%, +0.00% Max live registers: 5292 -> 5298 (+0.11%) Non SSA regs after NIR: 26638 -> 26464 (-0.65%) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38996>
This commit is contained in:
parent
6a7ff83874
commit
e3fd1b0ac0
1 changed files with 23 additions and 7 deletions
|
|
@ -1477,6 +1477,20 @@ brw_print_fs_urb_setup(FILE *fp, const struct brw_wm_prog_data *prog_data,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
brw_nir_cleanup_pre_wm_prog_data(nir_shader *nir)
|
||||
{
|
||||
bool progress;
|
||||
do {
|
||||
progress = false;
|
||||
NIR_PASS(progress, nir, nir_opt_algebraic);
|
||||
NIR_PASS(progress, nir, nir_opt_copy_prop);
|
||||
NIR_PASS(progress, nir, nir_opt_constant_folding);
|
||||
NIR_PASS(progress, nir, nir_opt_dce);
|
||||
NIR_PASS(progress, nir, nir_opt_cse);
|
||||
} while (progress);
|
||||
}
|
||||
|
||||
const unsigned *
|
||||
brw_compile_fs(const struct brw_compiler *compiler,
|
||||
struct brw_compile_fs_params *params)
|
||||
|
|
@ -1538,6 +1552,15 @@ brw_compile_fs(const struct brw_compiler *compiler,
|
|||
|
||||
NIR_PASS(_, nir, brw_nir_move_interpolation_to_top);
|
||||
|
||||
brw_nir_cleanup_pre_wm_prog_data(nir);
|
||||
|
||||
int per_primitive_offsets[VARYING_SLOT_MAX];
|
||||
memset(per_primitive_offsets, -1, sizeof(per_primitive_offsets));
|
||||
|
||||
brw_nir_populate_wm_prog_data(nir, compiler->devinfo, key, prog_data,
|
||||
params->mue_map,
|
||||
per_primitive_offsets);
|
||||
|
||||
if (!brw_wm_prog_key_is_dynamic(key)) {
|
||||
uint32_t f = 0;
|
||||
|
||||
|
|
@ -1572,13 +1595,6 @@ brw_compile_fs(const struct brw_compiler *compiler,
|
|||
brw_postprocess_nir_out_of_ssa(nir, 0, params->base.archiver,
|
||||
debug_enabled);
|
||||
|
||||
int per_primitive_offsets[VARYING_SLOT_MAX];
|
||||
memset(per_primitive_offsets, -1, sizeof(per_primitive_offsets));
|
||||
|
||||
brw_nir_populate_wm_prog_data(nir, compiler->devinfo, key, prog_data,
|
||||
params->mue_map,
|
||||
per_primitive_offsets);
|
||||
|
||||
if (unlikely(debug_enabled))
|
||||
brw_print_fs_urb_setup(stderr, prog_data, per_primitive_offsets);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue