From: Thomas H.P. Andersen Date: Tue, 11 Jul 2023 16:22:29 +0000 (+0200) Subject: tgsi: remove unused tgsi_shader_info.uses_derivatives X-Git-Tag: upstream/23.3.3~5436 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=395a2409cb9a1a29149bdcc1a2afc1979b9491db;p=platform%2Fupstream%2Fmesa.git tgsi: remove unused tgsi_shader_info.uses_derivatives Reviewed-by: Charmaine Lee Reviewed-by: Christian Gmeiner Part-of: --- diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c index ecc7f2b..83a3b5b 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c @@ -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; } diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index 6629753..b793caf 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -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++; } diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h index 80d67e4..83eed40 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h @@ -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;