tgsi: remove unused tgsi_shader_info.uses_derivatives

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
This commit is contained in:
Thomas H.P. Andersen
2023-07-11 18:22:29 +02:00
committed by Marge Bot
parent 908441e0ee
commit 395a2409cb
3 changed files with 1 additions and 51 deletions
+1 -20
View File
@@ -164,22 +164,7 @@ static void scan_instruction(const struct nir_shader *nir,
{
info->num_instructions = 2;
if (instr->type == nir_instr_type_alu) {
const 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_variable *texture = tex_get_texture_var(tex);
@@ -190,10 +175,6 @@ static void scan_instruction(const struct nir_shader *nir,
case nir_texop_tex:
info->opcode_count[TGSI_OPCODE_TEX]++;
FALLTHROUGH;
case nir_texop_txb:
case nir_texop_lod:
info->uses_derivatives = true;
break;
default:
break;
}
-30
View File
@@ -76,33 +76,6 @@ is_texture_inst(enum tgsi_opcode opcode)
}
/**
* Is the opcode an instruction which computes a derivative explicitly or
* implicitly?
*/
static bool
computes_derivative(enum tgsi_opcode opcode)
{
if (tgsi_get_opcode_info(opcode)->is_tex) {
return opcode != TGSI_OPCODE_TG4 &&
opcode != TGSI_OPCODE_TXD &&
opcode != TGSI_OPCODE_TXF &&
opcode != TGSI_OPCODE_TXF_LZ &&
opcode != TGSI_OPCODE_TEX_LZ &&
opcode != TGSI_OPCODE_TXL &&
opcode != TGSI_OPCODE_TXL2 &&
opcode != TGSI_OPCODE_TXQ &&
opcode != TGSI_OPCODE_TXQS;
}
return opcode == TGSI_OPCODE_DDX || opcode == TGSI_OPCODE_DDX_FINE ||
opcode == TGSI_OPCODE_DDY || opcode == TGSI_OPCODE_DDY_FINE ||
opcode == TGSI_OPCODE_SAMPLE ||
opcode == TGSI_OPCODE_SAMPLE_B ||
opcode == TGSI_OPCODE_SAMPLE_C;
}
static void
scan_src_operand(struct tgsi_shader_info *info,
const struct tgsi_full_instruction *fullinst,
@@ -464,9 +437,6 @@ scan_instruction(struct tgsi_shader_info *info,
}
}
if (computes_derivative(fullinst->Instruction.Opcode))
info->uses_derivatives = true;
info->num_instructions++;
}
-1
View File
@@ -104,7 +104,6 @@ struct tgsi_shader_info
bool writes_viewport_index;
bool writes_layer;
bool writes_memory; /**< contains stores or atomics to buffers or images */
bool uses_derivatives;
bool uses_bindless_samplers;
bool uses_bindless_images;
bool uses_fbfetch;