From 0797a14c52c1537f62ccf179148ced6bd00c7b6a Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sat, 19 Oct 2024 15:21:09 +0200 Subject: [PATCH] llvmpipe: Remove unused AF code The table and some other parameters are not used. Reviewed-by: Aleksi Sapon Reviewed-by: Adam Jackson Part-of: --- src/gallium/auxiliary/draw/draw_llvm.c | 11 -- .../draw/draw_pt_fetch_shade_pipeline_llvm.c | 2 - .../auxiliary/gallivm/lp_bld_jit_sample.c | 2 - .../auxiliary/gallivm/lp_bld_jit_types.c | 6 - .../auxiliary/gallivm/lp_bld_jit_types.h | 5 - src/gallium/auxiliary/gallivm/lp_bld_nir.c | 1 - src/gallium/auxiliary/gallivm/lp_bld_nir.h | 2 - .../auxiliary/gallivm/lp_bld_nir_soa.c | 1 - src/gallium/auxiliary/gallivm/lp_bld_sample.c | 146 ------------------ src/gallium/auxiliary/gallivm/lp_bld_sample.h | 5 - .../auxiliary/gallivm/lp_bld_sample_soa.c | 24 +-- src/gallium/auxiliary/gallivm/lp_bld_tgsi.h | 1 - src/gallium/drivers/llvmpipe/lp_jit.h | 3 - src/gallium/drivers/llvmpipe/lp_setup.c | 2 - src/gallium/drivers/llvmpipe/lp_state_cs.c | 13 -- src/gallium/drivers/llvmpipe/lp_state_fs.c | 1 - .../drivers/llvmpipe/lp_texture_handle.c | 4 +- 17 files changed, 4 insertions(+), 225 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 3ea87e4abbc..d1b52508fdc 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -610,9 +610,6 @@ generate_vs(struct draw_llvm_variant *variant, params.info = &llvm->draw->vs.vertex_shader->info; params.ssbo_ptr = ssbos_ptr; params.image = draw_image; - params.aniso_filter_table = lp_jit_resources_aniso_filter_table(variant->gallivm, - variant->resources_type, - resources_ptr); if (llvm->draw->vs.vertex_shader->state.ir.nir && llvm->draw->vs.vertex_shader->state.type == PIPE_SHADER_IR_NIR) { @@ -2464,10 +2461,6 @@ draw_gs_llvm_generate(struct draw_llvm *llvm, params.ssbo_ptr = ssbos_ptr; params.image = image; params.gs_vertex_streams = variant->shader->base.num_vertex_streams; - params.aniso_filter_table = lp_jit_resources_aniso_filter_table(gallivm, - variant->resources_type, - resources_ptr); - if (llvm->draw->gs.geometry_shader->state.type == PIPE_SHADER_IR_TGSI) lp_build_tgsi_soa(variant->gallivm, @@ -3125,9 +3118,6 @@ draw_tcs_llvm_generate(struct draw_llvm *llvm, params.image = image; params.coro = &coro_info; params.tcs_iface = &tcs_iface.base; - params.aniso_filter_table = lp_jit_resources_aniso_filter_table(gallivm, - variant->resources_type, - resources_ptr); lp_build_nir_soa(variant->gallivm, llvm->draw->tcs.tess_ctrl_shader->state.ir.nir, @@ -3657,7 +3647,6 @@ draw_tes_llvm_generate(struct draw_llvm *llvm, params.ssbo_ptr = ssbos_ptr; params.image = image; params.tes_iface = &tes_iface.base; - params.aniso_filter_table = lp_jit_resources_aniso_filter_table(gallivm, variant->resources_type, resources_ptr); lp_build_nir_soa(variant->gallivm, llvm->draw->tes.tess_eval_shader->state.ir.nir, diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c index caf3cb0ec77..e4c681f7817 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c @@ -453,8 +453,6 @@ llvm_middle_end_bind_parameters(struct draw_pt_middle_end *middle) llvm->jit_resources[shader_type].ssbos[i].u = (const uint32_t *)fake_const_buf; } } - - llvm->jit_resources[shader_type].aniso_filter_table = lp_build_sample_aniso_filter_table(); } llvm->vs_jit_context.planes = diff --git a/src/gallium/auxiliary/gallivm/lp_bld_jit_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_jit_sample.c index af8b7d37e9e..09e58652a91 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_jit_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_jit_sample.c @@ -225,8 +225,6 @@ lp_bld_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base args[num_args++] = texture_descriptor; args[num_args++] = sampler_desc_ptr; - args[num_args++] = params->aniso_filter_table; - LLVMTypeRef coord_type; if (op_type == LP_SAMPLER_OP_FETCH) coord_type = lp_build_int_vec_type(gallivm, params->type); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c b/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c index 5b1401ca3d2..22d5266d219 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_jit_types.c @@ -296,7 +296,6 @@ lp_build_jit_resources_type(struct gallivm_state *gallivm) PIPE_MAX_SAMPLERS); elem_types[LP_JIT_RES_IMAGES] = LLVMArrayType(image_type, PIPE_MAX_SHADER_IMAGES); - elem_types[LP_JIT_RES_ANISO_FILTER_TABLE] = LLVMPointerType(LLVMFloatTypeInContext(gallivm->context), 0); resources_type = LLVMStructTypeInContext(gallivm->context, elem_types, ARRAY_SIZE(elem_types), 0); @@ -316,9 +315,6 @@ lp_build_jit_resources_type(struct gallivm_state *gallivm) LP_CHECK_MEMBER_OFFSET(struct lp_jit_resources, images, gallivm->target, resources_type, LP_JIT_RES_IMAGES); - LP_CHECK_MEMBER_OFFSET(struct lp_jit_resources, aniso_filter_table, - gallivm->target, resources_type, - LP_JIT_RES_ANISO_FILTER_TABLE); return resources_type; } @@ -802,8 +798,6 @@ lp_build_sample_function_type(struct gallivm_state *gallivm, uint32_t sample_key arg_types[num_params++] = LLVMInt64TypeInContext(gallivm->context); arg_types[num_params++] = LLVMInt64TypeInContext(gallivm->context); - arg_types[num_params++] = LLVMPointerType(LLVMFloatTypeInContext(gallivm->context), 0); - for (unsigned i = 0; i < 4; i++) arg_types[num_params++] = coord_type; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_jit_types.h b/src/gallium/auxiliary/gallivm/lp_bld_jit_types.h index c23a69c7ed5..b8d3c897dfa 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_jit_types.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_jit_types.h @@ -147,7 +147,6 @@ struct lp_jit_resources { struct lp_jit_texture textures[PIPE_MAX_SHADER_SAMPLER_VIEWS]; struct lp_jit_sampler samplers[PIPE_MAX_SAMPLERS]; struct lp_jit_image images[PIPE_MAX_SHADER_IMAGES]; - const float *aniso_filter_table; }; enum { @@ -156,7 +155,6 @@ enum { LP_JIT_RES_TEXTURES, LP_JIT_RES_SAMPLERS, LP_JIT_RES_IMAGES, - LP_JIT_RES_ANISO_FILTER_TABLE, LP_JIT_RES_COUNT, }; @@ -175,9 +173,6 @@ enum { #define lp_jit_resources_images(_gallivm, _type, _ptr) \ lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_RES_IMAGES, "images") -#define lp_jit_resources_aniso_filter_table(_gallivm, _type, _ptr) \ - lp_build_struct_get2(_gallivm, _type, _ptr, LP_JIT_RES_ANISO_FILTER_TABLE, "aniso_filter_table") - LLVMTypeRef lp_build_jit_resources_type(struct gallivm_state *gallivm); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 510b1547536..a5700766449 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -2687,7 +2687,6 @@ visit_tex(struct lp_build_nir_context *bld_base, nir_tex_instr *instr) params.texel = texel; params.lod = explicit_lod; params.ms_index = ms_index; - params.aniso_filter_table = bld_base->aniso_filter_table; params.texture_resource = texture_resource; params.sampler_resource = sampler_resource; bld_base->tex(bld_base, ¶ms); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.h b/src/gallium/auxiliary/gallivm/lp_bld_nir.h index 4a731ea5d95..e04e2c09ac1 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.h @@ -89,8 +89,6 @@ struct lp_build_nir_context /** Value range analysis hash table used in code generation. */ struct hash_table *range_ht; - LLVMValueRef aniso_filter_table; - LLVMValueRef func; nir_shader *shader; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c index 31d587c973a..2eecb1d7bdf 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c @@ -3160,7 +3160,6 @@ void lp_build_nir_soa_func(struct gallivm_state *gallivm, bld.resources_ptr = params->resources_ptr; bld.thread_data_type = params->thread_data_type; bld.thread_data_ptr = params->thread_data_ptr; - bld.bld_base.aniso_filter_table = params->aniso_filter_table; bld.image = params->image; bld.shared_ptr = params->shared_ptr; bld.payload_ptr = params->payload_ptr; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 5c377abef6e..f588f773b6b 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -2541,149 +2541,3 @@ lp_build_reduce_filter_3d(struct lp_build_context *bld, break; } } - - -/* - * generated from - * const float alpha = 2; - * for (unsigned i = 0; i < WEIGHT_LUT_SIZE; i++) { - * const float r2 = (float) i / (float) (WEIGHT_LUT_SIZE - 1); - * const float weight = (float)expf(-alpha * r2); - */ -static const float aniso_filter_table[1024] = { - 1.000000, 0.998047, 0.996098, 0.994152, 0.992210, 0.990272, 0.988338, 0.986408, - 0.984481, 0.982559, 0.980640, 0.978724, 0.976813, 0.974905, 0.973001, 0.971100, - 0.969204, 0.967311, 0.965421, 0.963536, 0.961654, 0.959776, 0.957901, 0.956030, - 0.954163, 0.952299, 0.950439, 0.948583, 0.946730, 0.944881, 0.943036, 0.941194, - 0.939356, 0.937521, 0.935690, 0.933862, 0.932038, 0.930218, 0.928401, 0.926588, - 0.924778, 0.922972, 0.921169, 0.919370, 0.917575, 0.915782, 0.913994, 0.912209, - 0.910427, 0.908649, 0.906874, 0.905103, 0.903335, 0.901571, 0.899810, 0.898052, - 0.896298, 0.894548, 0.892801, 0.891057, 0.889317, 0.887580, 0.885846, 0.884116, - 0.882389, 0.880666, 0.878946, 0.877229, 0.875516, 0.873806, 0.872099, 0.870396, - 0.868696, 0.866999, 0.865306, 0.863616, 0.861929, 0.860245, 0.858565, 0.856888, - 0.855215, 0.853544, 0.851877, 0.850213, 0.848553, 0.846896, 0.845241, 0.843591, - 0.841943, 0.840299, 0.838657, 0.837019, 0.835385, 0.833753, 0.832124, 0.830499, - 0.828877, 0.827258, 0.825643, 0.824030, 0.822421, 0.820814, 0.819211, 0.817611, - 0.816014, 0.814420, 0.812830, 0.811242, 0.809658, 0.808076, 0.806498, 0.804923, - 0.803351, 0.801782, 0.800216, 0.798653, 0.797093, 0.795536, 0.793982, 0.792432, - 0.790884, 0.789339, 0.787798, 0.786259, 0.784723, 0.783191, 0.781661, 0.780134, - 0.778610, 0.777090, 0.775572, 0.774057, 0.772545, 0.771037, 0.769531, 0.768028, - 0.766528, 0.765030, 0.763536, 0.762045, 0.760557, 0.759071, 0.757589, 0.756109, - 0.754632, 0.753158, 0.751687, 0.750219, 0.748754, 0.747291, 0.745832, 0.744375, - 0.742921, 0.741470, 0.740022, 0.738577, 0.737134, 0.735694, 0.734258, 0.732823, - 0.731392, 0.729964, 0.728538, 0.727115, 0.725695, 0.724278, 0.722863, 0.721451, - 0.720042, 0.718636, 0.717232, 0.715831, 0.714433, 0.713038, 0.711645, 0.710255, - 0.708868, 0.707483, 0.706102, 0.704723, 0.703346, 0.701972, 0.700601, 0.699233, - 0.697867, 0.696504, 0.695144, 0.693786, 0.692431, 0.691079, 0.689729, 0.688382, - 0.687037, 0.685696, 0.684356, 0.683020, 0.681686, 0.680354, 0.679025, 0.677699, - 0.676376, 0.675054, 0.673736, 0.672420, 0.671107, 0.669796, 0.668488, 0.667182, - 0.665879, 0.664579, 0.663281, 0.661985, 0.660692, 0.659402, 0.658114, 0.656828, - 0.655546, 0.654265, 0.652987, 0.651712, 0.650439, 0.649169, 0.647901, 0.646635, - 0.645372, 0.644112, 0.642854, 0.641598, 0.640345, 0.639095, 0.637846, 0.636601, - 0.635357, 0.634116, 0.632878, 0.631642, 0.630408, 0.629177, 0.627948, 0.626721, - 0.625497, 0.624276, 0.623056, 0.621839, 0.620625, 0.619413, 0.618203, 0.616996, - 0.615790, 0.614588, 0.613387, 0.612189, 0.610994, 0.609800, 0.608609, 0.607421, - 0.606234, 0.605050, 0.603868, 0.602689, 0.601512, 0.600337, 0.599165, 0.597994, - 0.596826, 0.595661, 0.594497, 0.593336, 0.592177, 0.591021, 0.589866, 0.588714, - 0.587564, 0.586417, 0.585272, 0.584128, 0.582988, 0.581849, 0.580712, 0.579578, - 0.578446, 0.577317, 0.576189, 0.575064, 0.573940, 0.572819, 0.571701, 0.570584, - 0.569470, 0.568357, 0.567247, 0.566139, 0.565034, 0.563930, 0.562829, 0.561729, - 0.560632, 0.559537, 0.558444, 0.557354, 0.556265, 0.555179, 0.554094, 0.553012, - 0.551932, 0.550854, 0.549778, 0.548704, 0.547633, 0.546563, 0.545496, 0.544430, - 0.543367, 0.542306, 0.541246, 0.540189, 0.539134, 0.538081, 0.537030, 0.535981, - 0.534935, 0.533890, 0.532847, 0.531806, 0.530768, 0.529731, 0.528696, 0.527664, - 0.526633, 0.525604, 0.524578, 0.523553, 0.522531, 0.521510, 0.520492, 0.519475, - 0.518460, 0.517448, 0.516437, 0.515429, 0.514422, 0.513417, 0.512414, 0.511414, - 0.510415, 0.509418, 0.508423, 0.507430, 0.506439, 0.505450, 0.504462, 0.503477, - 0.502494, 0.501512, 0.500533, 0.499555, 0.498580, 0.497606, 0.496634, 0.495664, - 0.494696, 0.493730, 0.492765, 0.491803, 0.490842, 0.489884, 0.488927, 0.487972, - 0.487019, 0.486068, 0.485118, 0.484171, 0.483225, 0.482281, 0.481339, 0.480399, - 0.479461, 0.478524, 0.477590, 0.476657, 0.475726, 0.474797, 0.473870, 0.472944, - 0.472020, 0.471098, 0.470178, 0.469260, 0.468343, 0.467429, 0.466516, 0.465605, - 0.464695, 0.463788, 0.462882, 0.461978, 0.461075, 0.460175, 0.459276, 0.458379, - 0.457484, 0.456590, 0.455699, 0.454809, 0.453920, 0.453034, 0.452149, 0.451266, - 0.450384, 0.449505, 0.448627, 0.447751, 0.446876, 0.446003, 0.445132, 0.444263, - 0.443395, 0.442529, 0.441665, 0.440802, 0.439941, 0.439082, 0.438224, 0.437368, - 0.436514, 0.435662, 0.434811, 0.433961, 0.433114, 0.432268, 0.431424, 0.430581, - 0.429740, 0.428901, 0.428063, 0.427227, 0.426393, 0.425560, 0.424729, 0.423899, - 0.423071, 0.422245, 0.421420, 0.420597, 0.419776, 0.418956, 0.418137, 0.417321, - 0.416506, 0.415692, 0.414880, 0.414070, 0.413261, 0.412454, 0.411648, 0.410844, - 0.410042, 0.409241, 0.408442, 0.407644, 0.406848, 0.406053, 0.405260, 0.404469, - 0.403679, 0.402890, 0.402103, 0.401318, 0.400534, 0.399752, 0.398971, 0.398192, - 0.397414, 0.396638, 0.395863, 0.395090, 0.394319, 0.393548, 0.392780, 0.392013, - 0.391247, 0.390483, 0.389720, 0.388959, 0.388199, 0.387441, 0.386684, 0.385929, - 0.385175, 0.384423, 0.383672, 0.382923, 0.382175, 0.381429, 0.380684, 0.379940, - 0.379198, 0.378457, 0.377718, 0.376980, 0.376244, 0.375509, 0.374776, 0.374044, - 0.373313, 0.372584, 0.371856, 0.371130, 0.370405, 0.369682, 0.368960, 0.368239, - 0.367520, 0.366802, 0.366086, 0.365371, 0.364657, 0.363945, 0.363234, 0.362525, - 0.361817, 0.361110, 0.360405, 0.359701, 0.358998, 0.358297, 0.357597, 0.356899, - 0.356202, 0.355506, 0.354812, 0.354119, 0.353427, 0.352737, 0.352048, 0.351360, - 0.350674, 0.349989, 0.349306, 0.348623, 0.347942, 0.347263, 0.346585, 0.345908, - 0.345232, 0.344558, 0.343885, 0.343213, 0.342543, 0.341874, 0.341206, 0.340540, - 0.339874, 0.339211, 0.338548, 0.337887, 0.337227, 0.336568, 0.335911, 0.335255, - 0.334600, 0.333947, 0.333294, 0.332643, 0.331994, 0.331345, 0.330698, 0.330052, - 0.329408, 0.328764, 0.328122, 0.327481, 0.326842, 0.326203, 0.325566, 0.324930, - 0.324296, 0.323662, 0.323030, 0.322399, 0.321770, 0.321141, 0.320514, 0.319888, - 0.319263, 0.318639, 0.318017, 0.317396, 0.316776, 0.316157, 0.315540, 0.314924, - 0.314309, 0.313695, 0.313082, 0.312470, 0.311860, 0.311251, 0.310643, 0.310036, - 0.309431, 0.308827, 0.308223, 0.307621, 0.307021, 0.306421, 0.305822, 0.305225, - 0.304629, 0.304034, 0.303440, 0.302847, 0.302256, 0.301666, 0.301076, 0.300488, - 0.299902, 0.299316, 0.298731, 0.298148, 0.297565, 0.296984, 0.296404, 0.295825, - 0.295247, 0.294671, 0.294095, 0.293521, 0.292948, 0.292375, 0.291804, 0.291234, - 0.290666, 0.290098, 0.289531, 0.288966, 0.288401, 0.287838, 0.287276, 0.286715, - 0.286155, 0.285596, 0.285038, 0.284482, 0.283926, 0.283371, 0.282818, 0.282266, - 0.281714, 0.281164, 0.280615, 0.280067, 0.279520, 0.278974, 0.278429, 0.277885, - 0.277342, 0.276801, 0.276260, 0.275721, 0.275182, 0.274645, 0.274108, 0.273573, - 0.273038, 0.272505, 0.271973, 0.271442, 0.270912, 0.270382, 0.269854, 0.269327, - 0.268801, 0.268276, 0.267752, 0.267229, 0.266707, 0.266186, 0.265667, 0.265148, - 0.264630, 0.264113, 0.263597, 0.263082, 0.262568, 0.262056, 0.261544, 0.261033, - 0.260523, 0.260014, 0.259506, 0.259000, 0.258494, 0.257989, 0.257485, 0.256982, - 0.256480, 0.255979, 0.255479, 0.254980, 0.254482, 0.253985, 0.253489, 0.252994, - 0.252500, 0.252007, 0.251515, 0.251023, 0.250533, 0.250044, 0.249555, 0.249068, - 0.248582, 0.248096, 0.247611, 0.247128, 0.246645, 0.246163, 0.245683, 0.245203, - 0.244724, 0.244246, 0.243769, 0.243293, 0.242818, 0.242343, 0.241870, 0.241398, - 0.240926, 0.240456, 0.239986, 0.239517, 0.239049, 0.238583, 0.238117, 0.237651, - 0.237187, 0.236724, 0.236262, 0.235800, 0.235340, 0.234880, 0.234421, 0.233963, - 0.233506, 0.233050, 0.232595, 0.232141, 0.231688, 0.231235, 0.230783, 0.230333, - 0.229883, 0.229434, 0.228986, 0.228538, 0.228092, 0.227647, 0.227202, 0.226758, - 0.226315, 0.225873, 0.225432, 0.224992, 0.224552, 0.224114, 0.223676, 0.223239, - 0.222803, 0.222368, 0.221934, 0.221500, 0.221068, 0.220636, 0.220205, 0.219775, - 0.219346, 0.218917, 0.218490, 0.218063, 0.217637, 0.217212, 0.216788, 0.216364, - 0.215942, 0.215520, 0.215099, 0.214679, 0.214260, 0.213841, 0.213423, 0.213007, - 0.212591, 0.212175, 0.211761, 0.211347, 0.210935, 0.210523, 0.210111, 0.209701, - 0.209291, 0.208883, 0.208475, 0.208068, 0.207661, 0.207256, 0.206851, 0.206447, - 0.206044, 0.205641, 0.205239, 0.204839, 0.204439, 0.204039, 0.203641, 0.203243, - 0.202846, 0.202450, 0.202054, 0.201660, 0.201266, 0.200873, 0.200481, 0.200089, - 0.199698, 0.199308, 0.198919, 0.198530, 0.198143, 0.197756, 0.197369, 0.196984, - 0.196599, 0.196215, 0.195832, 0.195449, 0.195068, 0.194687, 0.194306, 0.193927, - 0.193548, 0.193170, 0.192793, 0.192416, 0.192041, 0.191665, 0.191291, 0.190917, - 0.190545, 0.190172, 0.189801, 0.189430, 0.189060, 0.188691, 0.188323, 0.187955, - 0.187588, 0.187221, 0.186856, 0.186491, 0.186126, 0.185763, 0.185400, 0.185038, - 0.184676, 0.184316, 0.183956, 0.183597, 0.183238, 0.182880, 0.182523, 0.182166, - 0.181811, 0.181455, 0.181101, 0.180747, 0.180394, 0.180042, 0.179690, 0.179339, - 0.178989, 0.178640, 0.178291, 0.177942, 0.177595, 0.177248, 0.176902, 0.176556, - 0.176211, 0.175867, 0.175524, 0.175181, 0.174839, 0.174497, 0.174157, 0.173816, - 0.173477, 0.173138, 0.172800, 0.172462, 0.172126, 0.171789, 0.171454, 0.171119, - 0.170785, 0.170451, 0.170118, 0.169786, 0.169454, 0.169124, 0.168793, 0.168463, - 0.168134, 0.167806, 0.167478, 0.167151, 0.166825, 0.166499, 0.166174, 0.165849, - 0.165525, 0.165202, 0.164879, 0.164557, 0.164236, 0.163915, 0.163595, 0.163275, - 0.162957, 0.162638, 0.162321, 0.162004, 0.161687, 0.161371, 0.161056, 0.160742, - 0.160428, 0.160114, 0.159802, 0.159489, 0.159178, 0.158867, 0.158557, 0.158247, - 0.157938, 0.157630, 0.157322, 0.157014, 0.156708, 0.156402, 0.156096, 0.155791, - 0.155487, 0.155183, 0.154880, 0.154578, 0.154276, 0.153975, 0.153674, 0.153374, - 0.153074, 0.152775, 0.152477, 0.152179, 0.151882, 0.151585, 0.151289, 0.150994, - 0.150699, 0.150404, 0.150111, 0.149817, 0.149525, 0.149233, 0.148941, 0.148650, - 0.148360, 0.148070, 0.147781, 0.147492, 0.147204, 0.146917, 0.146630, 0.146344, - 0.146058, 0.145772, 0.145488, 0.145204, 0.144920, 0.144637, 0.144354, 0.144072, - 0.143791, 0.143510, 0.143230, 0.142950, 0.142671, 0.142392, 0.142114, 0.141837, - 0.141560, 0.141283, 0.141007, 0.140732, 0.140457, 0.140183, 0.139909, 0.139636, - 0.139363, 0.139091, 0.138819, 0.138548, 0.138277, 0.138007, 0.137738, 0.137469, - 0.137200, 0.136932, 0.136665, 0.136398, 0.136131, 0.135865, 0.135600, 0.135335, -}; - - -const float * -lp_build_sample_aniso_filter_table(void) -{ - return aniso_filter_table; -} diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index 0b48c53e427..6c5ac2f9ffe 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -118,7 +118,6 @@ struct lp_sampler_params const LLVMValueRef *offsets; LLVMValueRef ms_index; LLVMValueRef lod; - LLVMValueRef aniso_filter_table; const struct lp_derivatives *derivs; LLVMValueRef *texel; @@ -512,8 +511,6 @@ struct lp_build_sample_context LLVMTypeRef resources_type; LLVMValueRef resources_ptr; - LLVMValueRef aniso_filter_table; - LLVMValueRef resident; }; @@ -794,7 +791,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, const struct lp_derivatives *derivs, /* optional */ LLVMValueRef lod, /* optional */ LLVMValueRef ms_index, /* optional */ - LLVMValueRef aniso_filter_table, LLVMValueRef *texel_out); @@ -923,7 +919,6 @@ LLVMValueRef lp_sample_load_mip_value(struct gallivm_state *gallivm, LLVMValueRef offsets, LLVMValueRef index1); -const float *lp_build_sample_aniso_filter_table(void); #ifdef __cplusplus } #endif diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index ec825ca342e..4b3212b19f1 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -2187,9 +2187,6 @@ lp_build_sample_ms_offset(struct lp_build_context *int_coord_bld, static void lp_build_sample_aniso(struct lp_build_sample_context *bld, - unsigned img_filter, - unsigned mip_filter, - bool is_gather, const LLVMValueRef *coords, const LLVMValueRef *offsets, LLVMValueRef ilevel0, @@ -2793,8 +2790,7 @@ lp_build_sample_general(struct lp_build_sample_context *bld, } if (sampler_state->aniso) { - lp_build_sample_aniso(bld, PIPE_TEX_FILTER_NEAREST, mip_filter, - false, coords, offsets, ilevel0, + lp_build_sample_aniso(bld, coords, offsets, ilevel0, ilevel1, lod_fpart, texels); } else if (min_filter == mag_filter) { /* no need to distinguish between minification and magnification */ @@ -3153,7 +3149,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, const struct lp_derivatives *derivs, /* optional */ LLVMValueRef lod, /* optional */ LLVMValueRef ms_index, /* optional */ - LLVMValueRef aniso_filter_table, LLVMValueRef *texel_out) { assert(static_texture_state); @@ -3227,7 +3222,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, bld.gallivm = gallivm; bld.resources_type = resources_type; bld.resources_ptr = resources_ptr; - bld.aniso_filter_table = aniso_filter_table; bld.static_sampler_state = &derived_sampler_state; bld.static_texture_state = static_texture_state; bld.dynamic_state = dynamic_state; @@ -3654,7 +3648,6 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, bld4.gallivm = bld.gallivm; bld4.resources_type = bld.resources_type; bld4.resources_ptr = bld.resources_ptr; - bld4.aniso_filter_table = aniso_filter_table; bld4.static_texture_state = bld.static_texture_state; bld4.static_sampler_state = bld.static_sampler_state; bld4.dynamic_state = bld.dynamic_state; @@ -3858,8 +3851,7 @@ lp_build_sample_gen_func(struct gallivm_state *gallivm, unsigned sampler_index, LLVMValueRef function, unsigned num_args, - unsigned sample_key, - bool has_aniso_filter_table) + unsigned sample_key) { LLVMBuilderRef old_builder; LLVMBasicBlockRef block; @@ -3869,7 +3861,6 @@ lp_build_sample_gen_func(struct gallivm_state *gallivm, LLVMValueRef ms_index = NULL; LLVMValueRef resources_ptr; LLVMValueRef thread_data_ptr = NULL; - LLVMValueRef aniso_filter_table = NULL; LLVMValueRef texel_out[4]; struct lp_derivatives derivs; struct lp_derivatives *deriv_ptr = NULL; @@ -3901,8 +3892,6 @@ lp_build_sample_gen_func(struct gallivm_state *gallivm, /* "unpack" arguments */ resources_ptr = LLVMGetParam(function, num_param++); - if (has_aniso_filter_table) - aniso_filter_table = LLVMGetParam(function, num_param++); if (need_cache) { thread_data_ptr = LLVMGetParam(function, num_param++); } @@ -3966,7 +3955,6 @@ lp_build_sample_gen_func(struct gallivm_state *gallivm, deriv_ptr, lod, ms_index, - aniso_filter_table, texel_out); LLVMBuildAggregateRet(gallivm->builder, texel_out, 4); @@ -4046,8 +4034,6 @@ lp_build_sample_soa_func(struct gallivm_state *gallivm, */ arg_types[num_param++] = LLVMTypeOf(params->resources_ptr); - if (params->aniso_filter_table) - arg_types[num_param++] = LLVMTypeOf(params->aniso_filter_table); if (need_cache) { arg_types[num_param++] = LLVMTypeOf(params->thread_data_ptr); } @@ -4112,14 +4098,11 @@ lp_build_sample_soa_func(struct gallivm_state *gallivm, sampler_index, function, num_param, - sample_key, - params->aniso_filter_table ? true : false); + sample_key); } unsigned num_args = 0; args[num_args++] = params->resources_ptr; - if (params->aniso_filter_table) - args[num_args++] = params->aniso_filter_table; if (need_cache) { args[num_args++] = params->thread_data_ptr; } @@ -4236,7 +4219,6 @@ lp_build_sample_soa(const struct lp_static_texture_state *static_texture_state, params->derivs, params->lod, params->ms_index, - params->aniso_filter_table, params->texel); } } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h index dfa467aa2c0..28bfa0374ad 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h @@ -289,7 +289,6 @@ struct lp_build_tgsi_params { LLVMValueRef kernel_args; const struct lp_build_fs_iface *fs_iface; unsigned gs_vertex_streams; - LLVMValueRef aniso_filter_table; LLVMValueRef current_func; struct hash_table *fns; LLVMValueRef scratch_ptr; diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index 006235e9f8f..672a42a103f 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -353,9 +353,6 @@ enum { #define lp_jit_cs_context_images(_gallivm, _type, _ptr) \ lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_IMAGES, "images") -#define lp_jit_cs_context_aniso_filter_table(_gallivm, _type, _ptr) \ - lp_build_struct_get2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_ANISO_FILTER_TABLE, "aniso_filter_table") - #define lp_jit_cs_context_kernel_args(_gallivm, _type, _ptr) \ lp_build_struct_get2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_KERNEL_ARGS, "kernel_args") diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 6682f20a9e8..76ea2c807e0 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -1101,8 +1101,6 @@ try_update_scene_state(struct lp_setup_context *setup) &setup->fs.current.jit_resources, sizeof setup->fs.current.jit_resources); - stored->jit_resources.aniso_filter_table = - lp_build_sample_aniso_filter_table(); stored->variant = setup->fs.current.variant; if (!lp_scene_add_frag_shader_reference(scene, diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index 5b21443be9f..ef169d98e4b 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -547,9 +547,6 @@ generate_compute(struct llvmpipe_context *lp, variant->jit_resources_type, params.resources_ptr); params.image = image; - params.aniso_filter_table = lp_jit_resources_aniso_filter_table(gallivm, - variant->jit_resources_type, - params.resources_ptr); lp_build_nir_soa_func(gallivm, shader->base.ir.nir, func->impl, @@ -837,9 +834,6 @@ generate_compute(struct llvmpipe_context *lp, params.payload_ptr = payload_ptr; params.coro = &coro_info; params.kernel_args = kernel_args_ptr; - params.aniso_filter_table = lp_jit_resources_aniso_filter_table(gallivm, - variant->jit_resources_type, - resources_ptr); params.mesh_iface = &mesh_iface.base; params.current_func = NULL; @@ -1629,7 +1623,6 @@ llvmpipe_cs_update_derived(struct llvmpipe_context *llvmpipe, const void *input) llvmpipe->images[PIPE_SHADER_COMPUTE]); struct lp_cs_context *csctx = llvmpipe->csctx; - csctx->cs.current.jit_resources.aniso_filter_table = lp_build_sample_aniso_filter_table(); if (input) { csctx->input = input; csctx->cs.current.jit_context.kernel_args = input; @@ -2302,9 +2295,6 @@ llvmpipe_task_update_derived(struct llvmpipe_context *llvmpipe) lp_csctx_set_cs_images(llvmpipe->task_ctx, ARRAY_SIZE(llvmpipe->images[PIPE_SHADER_TASK]), llvmpipe->images[PIPE_SHADER_TASK]); - - struct lp_cs_context *csctx = llvmpipe->task_ctx; - csctx->cs.current.jit_resources.aniso_filter_table = lp_build_sample_aniso_filter_table(); } void @@ -2338,7 +2328,4 @@ llvmpipe_mesh_update_derived(struct llvmpipe_context *llvmpipe) lp_csctx_set_cs_images(llvmpipe->mesh_ctx, ARRAY_SIZE(llvmpipe->images[PIPE_SHADER_MESH]), llvmpipe->images[PIPE_SHADER_MESH]); - - struct lp_cs_context *csctx = llvmpipe->mesh_ctx; - csctx->cs.current.jit_resources.aniso_filter_table = lp_build_sample_aniso_filter_table(); } diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index ac2cd933cf3..5414c6edfe0 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -1101,7 +1101,6 @@ generate_fs_loop(struct gallivm_state *gallivm, params.info = &shader->info.base; params.ssbo_ptr = ssbo_ptr; params.image = image; - params.aniso_filter_table = lp_jit_resources_aniso_filter_table(gallivm, resources_type, resources_ptr); /* Build the actual shader */ lp_build_nir_soa(gallivm, nir, ¶ms, outputs); diff --git a/src/gallium/drivers/llvmpipe/lp_texture_handle.c b/src/gallium/drivers/llvmpipe/lp_texture_handle.c index cc82119be67..4f68d87b785 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture_handle.c +++ b/src/gallium/drivers/llvmpipe/lp_texture_handle.c @@ -495,8 +495,6 @@ compile_sample_function(struct llvmpipe_context *ctx, struct lp_static_texture_s gallivm->texture_descriptor = LLVMGetParam(function, arg_index++); gallivm->sampler_descriptor = LLVMGetParam(function, arg_index++); - LLVMValueRef aniso_filter_table = LLVMGetParam(function, arg_index++); - LLVMValueRef coords[5]; for (unsigned i = 0; i < 4; i++) coords[i] = LLVMGetParam(function, arg_index++); @@ -528,7 +526,7 @@ compile_sample_function(struct llvmpipe_context *ctx, struct lp_static_texture_s if (supported) { lp_build_sample_soa_code(gallivm, texture, sampler, lp_build_sampler_soa_dynamic_state(sampler_soa), type, sample_key, 0, 0, cs.jit_resources_type, NULL, cs.jit_cs_thread_data_type, - NULL, coords, offsets, NULL, lod, ms_index, aniso_filter_table, texel_out); + NULL, coords, offsets, NULL, lod, ms_index, texel_out); } else { lp_build_sample_nop(gallivm, lp_build_texel_type(type, util_format_description(texture->format)), coords, texel_out); }