From 6c513ef4fdc23bb3aa7cbdff7e60db92884d4828 Mon Sep 17 00:00:00 2001 From: "Thomas H.P. Andersen" Date: Tue, 11 Jul 2023 18:22:27 +0200 Subject: [PATCH] tgsi: remove unused tgsi_shader_info fields Removes: uses_persp_center uses_persp_centroid uses_persp_sample uses_linear_center uses_linear_centroid uses_linear_sample Reviewed-by: Charmaine Lee Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi_info.c | 32 +------------- src/gallium/auxiliary/tgsi/tgsi_scan.c | 44 -------------------- src/gallium/auxiliary/tgsi/tgsi_scan.h | 6 --- 3 files changed, 1 insertion(+), 81 deletions(-) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c index cd0be2ccfa4..dbdb1150301 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c @@ -298,43 +298,13 @@ static void scan_instruction(const struct nir_shader *nir, const nir_variable *var = nir_intrinsic_get_var(intr, 0); const nir_variable_mode mode = var->data.mode; nir_deref_instr *const deref = nir_src_as_deref(intr->src[0]); - enum glsl_base_type base_type = - glsl_get_base_type(glsl_without_array(var->type)); if (nir_deref_instr_has_indirect(deref)) { if (mode == nir_var_shader_in) info->indirect_files |= (1 << TGSI_FILE_INPUT); } - if (mode == nir_var_shader_in) { + if (mode == nir_var_shader_in) gather_intrinsic_load_deref_info(nir, intr, deref, need_texcoord, var, info); - - switch (var->data.interpolation) { - case INTERP_MODE_NONE: - if (glsl_base_type_is_integer(base_type)) - break; - if (var->data.per_primitive) - break; - - FALLTHROUGH; - case INTERP_MODE_SMOOTH: - if (var->data.sample) - info->uses_persp_sample = true; - else if (var->data.centroid) - info->uses_persp_centroid = true; - else - info->uses_persp_center = true; - break; - - case INTERP_MODE_NOPERSPECTIVE: - if (var->data.sample) - info->uses_linear_sample = true; - else if (var->data.centroid) - info->uses_linear_centroid = true; - else - info->uses_linear_center = true; - break; - } - } break; } case nir_intrinsic_interp_deref_at_centroid: diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index 495445d3fbe..95ae263dffb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -169,50 +169,6 @@ scan_src_operand(struct tgsi_shader_info *info, if (name == TGSI_SEMANTIC_POSITION && usage_mask_after_swizzle & TGSI_WRITEMASK_Z) info->reads_z = true; - - /* Process only interpolated varyings. Don't include POSITION. - * Don't include integer varyings, because they are not - * interpolated. Don't process inputs interpolated by INTERP - * opcodes. Those are tracked separately. - */ - if ((!is_interp_instruction || src_index != 0) && - (name == TGSI_SEMANTIC_GENERIC || - name == TGSI_SEMANTIC_TEXCOORD || - name == TGSI_SEMANTIC_COLOR || - name == TGSI_SEMANTIC_BCOLOR || - name == TGSI_SEMANTIC_FOG || - name == TGSI_SEMANTIC_CLIPDIST)) { - switch (info->input_interpolate[input]) { - case TGSI_INTERPOLATE_COLOR: - case TGSI_INTERPOLATE_PERSPECTIVE: - switch (info->input_interpolate_loc[input]) { - case TGSI_INTERPOLATE_LOC_CENTER: - info->uses_persp_center = true; - break; - case TGSI_INTERPOLATE_LOC_CENTROID: - info->uses_persp_centroid = true; - break; - case TGSI_INTERPOLATE_LOC_SAMPLE: - info->uses_persp_sample = true; - break; - } - break; - case TGSI_INTERPOLATE_LINEAR: - switch (info->input_interpolate_loc[input]) { - case TGSI_INTERPOLATE_LOC_CENTER: - info->uses_linear_center = true; - break; - case TGSI_INTERPOLATE_LOC_CENTROID: - info->uses_linear_centroid = true; - break; - case TGSI_INTERPOLATE_LOC_SAMPLE: - info->uses_linear_sample = true; - break; - } - break; - /* TGSI_INTERPOLATE_CONSTANT doesn't do any interpolation. */ - } - } } } diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h index 1beef49a8fe..3550bebde66 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h @@ -90,12 +90,6 @@ struct tgsi_shader_info bool writes_samplemask; /**< does fragment shader write sample mask? */ bool writes_edgeflag; /**< vertex shader outputs edgeflag */ bool uses_kill; /**< KILL or KILL_IF instruction used? */ - bool uses_persp_center; - bool uses_persp_centroid; - bool uses_persp_sample; - bool uses_linear_center; - bool uses_linear_centroid; - bool uses_linear_sample; bool uses_persp_opcode_interp_centroid; bool uses_persp_opcode_interp_offset; bool uses_persp_opcode_interp_sample;