mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
intel/fs/xe2+: Attempt to build quad-SIMD8 and dual-SIMD16 FS variants on Xe2+ platforms.
Extend the pre-existing dual-SIMD8 compilation path in brw_compile_fs() to attempt quad-SIMD8 and dual-SIMD16 compiles. Instead of building every possible dispatch mode and then picking one based on cycle-count heuristics, this attempts to only build a single multipolygon kernel -- The different mulipolygon dispatch modes are tried in the expected order of decreasing performance (quad-SIMD8, dual-SIMD16 then dual-SIMD8), the first one that successfully compiles without spills is taken as a simple heuristic, and no further multipolygon builds are attempted. Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
This commit is contained in:
parent
8cd8d6bccc
commit
ab0eff4388
1 changed files with 66 additions and 22 deletions
|
|
@ -7788,30 +7788,74 @@ brw_compile_fs(const struct brw_compiler *compiler,
|
|||
}
|
||||
|
||||
if (devinfo->ver >= 12 && !has_spilled &&
|
||||
v8 && v8->max_dispatch_width >= 16 &&
|
||||
params->max_polygons >= 2 && !key->coarse_pixel &&
|
||||
2 * prog_data->num_varying_inputs <= MAX_VARYING &&
|
||||
INTEL_SIMD(FS, 2X8)) {
|
||||
/* Try a dual-SIMD8 compile */
|
||||
vmulti = std::make_unique<fs_visitor>(compiler, ¶ms->base, key,
|
||||
prog_data, nir, 16, 2,
|
||||
params->base.stats != NULL,
|
||||
debug_enabled);
|
||||
if (v8)
|
||||
vmulti->import_uniforms(v8.get());
|
||||
else if (v16)
|
||||
vmulti->import_uniforms(v16.get());
|
||||
params->max_polygons >= 2 && !key->coarse_pixel) {
|
||||
fs_visitor *vbase = v8 ? v8.get() : v16 ? v16.get() : v32.get();
|
||||
assert(vbase);
|
||||
|
||||
if (devinfo->ver >= 20 &&
|
||||
params->max_polygons >= 4 &&
|
||||
vbase->max_dispatch_width >= 32 &&
|
||||
4 * prog_data->num_varying_inputs <= MAX_VARYING &&
|
||||
INTEL_SIMD(FS, 4X8)) {
|
||||
/* Try a quad-SIMD8 compile */
|
||||
vmulti = std::make_unique<fs_visitor>(compiler, ¶ms->base, key,
|
||||
prog_data, nir, 32, 4,
|
||||
params->base.stats != NULL,
|
||||
debug_enabled);
|
||||
vmulti->import_uniforms(vbase);
|
||||
if (!vmulti->run_fs(false, params->use_rep_send)) {
|
||||
brw_shader_perf_log(compiler, params->base.log_data,
|
||||
"Quad-SIMD8 shader failed to compile: %s\n",
|
||||
vmulti->fail_msg);
|
||||
} else {
|
||||
multi_cfg = vmulti->cfg;
|
||||
assert(!vmulti->spilled_any_registers);
|
||||
}
|
||||
}
|
||||
|
||||
if (!multi_cfg && devinfo->ver >= 20 &&
|
||||
vbase->max_dispatch_width >= 32 &&
|
||||
2 * prog_data->num_varying_inputs <= MAX_VARYING &&
|
||||
INTEL_SIMD(FS, 2X16)) {
|
||||
/* Try a dual-SIMD16 compile */
|
||||
vmulti = std::make_unique<fs_visitor>(compiler, ¶ms->base, key,
|
||||
prog_data, nir, 32, 2,
|
||||
params->base.stats != NULL,
|
||||
debug_enabled);
|
||||
vmulti->import_uniforms(vbase);
|
||||
if (!vmulti->run_fs(false, params->use_rep_send)) {
|
||||
brw_shader_perf_log(compiler, params->base.log_data,
|
||||
"Dual-SIMD16 shader failed to compile: %s\n",
|
||||
vmulti->fail_msg);
|
||||
} else {
|
||||
multi_cfg = vmulti->cfg;
|
||||
assert(!vmulti->spilled_any_registers);
|
||||
}
|
||||
}
|
||||
|
||||
if (!multi_cfg && vbase->max_dispatch_width >= 16 &&
|
||||
2 * prog_data->num_varying_inputs <= MAX_VARYING &&
|
||||
INTEL_SIMD(FS, 2X8)) {
|
||||
/* Try a dual-SIMD8 compile */
|
||||
vmulti = std::make_unique<fs_visitor>(compiler, ¶ms->base, key,
|
||||
prog_data, nir, 16, 2,
|
||||
params->base.stats != NULL,
|
||||
debug_enabled);
|
||||
vmulti->import_uniforms(vbase);
|
||||
if (!vmulti->run_fs(allow_spilling, params->use_rep_send)) {
|
||||
brw_shader_perf_log(compiler, params->base.log_data,
|
||||
"Dual-SIMD8 shader failed to compile: %s\n",
|
||||
vmulti->fail_msg);
|
||||
} else {
|
||||
multi_cfg = vmulti->cfg;
|
||||
}
|
||||
}
|
||||
|
||||
if (multi_cfg) {
|
||||
assert(vmulti->payload().num_regs % reg_unit(devinfo) == 0);
|
||||
prog_data->base.dispatch_grf_start_reg = vmulti->payload().num_regs / reg_unit(devinfo);
|
||||
|
||||
if (!vmulti->run_fs(allow_spilling, params->use_rep_send)) {
|
||||
brw_shader_perf_log(compiler, params->base.log_data,
|
||||
"Dual-SIMD8 shader failed to compile: %s\n",
|
||||
vmulti->fail_msg);
|
||||
} else {
|
||||
multi_cfg = vmulti->cfg;
|
||||
prog_data->base.dispatch_grf_start_reg = vmulti->payload().num_regs;
|
||||
prog_data->reg_blocks_8 = brw_register_blocks(vmulti->grf_used);
|
||||
has_spilled = vmulti->spilled_any_registers;
|
||||
allow_spilling = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue