mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 06:20:09 +01:00
radeonsi: remove redundant si_shader_info::uses_derivatives
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6624>
This commit is contained in:
parent
f3f08bca23
commit
757f790ad8
4 changed files with 6 additions and 29 deletions
|
|
@ -2133,7 +2133,7 @@ void si_get_ps_prolog_key(struct si_shader *shader, union si_shader_part_key *ke
|
|||
key->ps_prolog.num_input_sgprs = shader->info.num_input_sgprs;
|
||||
key->ps_prolog.num_input_vgprs = shader->info.num_input_vgprs;
|
||||
key->ps_prolog.wqm =
|
||||
info->uses_derivatives &&
|
||||
info->base.fs.needs_helper_invocations &&
|
||||
(key->ps_prolog.colors_read || key->ps_prolog.states.force_persp_sample_interp ||
|
||||
key->ps_prolog.states.force_linear_sample_interp ||
|
||||
key->ps_prolog.states.force_persp_center_interp ||
|
||||
|
|
|
|||
|
|
@ -371,7 +371,6 @@ struct si_shader_info {
|
|||
bool writes_primid;
|
||||
bool writes_viewport_index;
|
||||
bool writes_layer;
|
||||
bool uses_derivatives;
|
||||
bool uses_bindless_samplers;
|
||||
bool uses_bindless_images;
|
||||
bool uses_fbfetch;
|
||||
|
|
|
|||
|
|
@ -230,22 +230,7 @@ static void scan_io_usage(struct si_shader_info *info, nir_intrinsic_instr *intr
|
|||
static void scan_instruction(const struct nir_shader *nir, struct si_shader_info *info,
|
||||
nir_instr *instr)
|
||||
{
|
||||
if (instr->type == nir_instr_type_alu) {
|
||||
nir_alu_instr *alu = nir_instr_as_alu(instr);
|
||||
|
||||
switch (alu->op) {
|
||||
case nir_op_fddx:
|
||||
case nir_op_fddy:
|
||||
case nir_op_fddx_fine:
|
||||
case nir_op_fddy_fine:
|
||||
case nir_op_fddx_coarse:
|
||||
case nir_op_fddy_coarse:
|
||||
info->uses_derivatives = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (instr->type == nir_instr_type_tex) {
|
||||
if (instr->type == nir_instr_type_tex) {
|
||||
nir_tex_instr *tex = nir_instr_as_tex(instr);
|
||||
const nir_deref_instr *deref = tex_get_texture_deref(tex);
|
||||
nir_variable *var = deref ? nir_deref_instr_get_variable(deref) : NULL;
|
||||
|
|
@ -254,16 +239,6 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
|
|||
if (deref->mode != nir_var_uniform || var->data.bindless)
|
||||
info->uses_bindless_samplers = true;
|
||||
}
|
||||
|
||||
switch (tex->op) {
|
||||
case nir_texop_tex:
|
||||
case nir_texop_txb:
|
||||
case nir_texop_lod:
|
||||
info->uses_derivatives = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (instr->type == nir_instr_type_intrinsic) {
|
||||
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,10 @@ void si_get_ir_cache_key(struct si_shader_selector *sel, bool ngg, bool es,
|
|||
shader_variant_flags |= 1 << 1;
|
||||
if (si_get_wave_size(sel->screen, sel->info.stage, ngg, es, false, false) == 32)
|
||||
shader_variant_flags |= 1 << 2;
|
||||
if (sel->info.stage == MESA_SHADER_FRAGMENT && sel->info.uses_derivatives && sel->info.base.fs.uses_discard &&
|
||||
if (sel->info.stage == MESA_SHADER_FRAGMENT &&
|
||||
/* Derivatives imply helper invocations so check for needs_helper_invocations. */
|
||||
sel->info.base.fs.needs_helper_invocations &&
|
||||
sel->info.base.fs.uses_discard &&
|
||||
sel->screen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL))
|
||||
shader_variant_flags |= 1 << 3;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue