From 17b9af42b77aab2d8be446fbc3447027b8829557 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 13 Mar 2025 16:57:39 +0100 Subject: [PATCH] llvmpipe: remove all clover support code Reviewed-by: Alyssa Rosenzweig Part-of: --- .../auxiliary/gallivm/lp_bld_nir_soa.c | 41 ------------------- src/gallium/auxiliary/gallivm/lp_bld_tgsi.h | 1 - src/gallium/drivers/llvmpipe/lp_jit.c | 4 -- src/gallium/drivers/llvmpipe/lp_jit.h | 6 --- src/gallium/drivers/llvmpipe/lp_state_cs.c | 24 +---------- 5 files changed, 2 insertions(+), 74 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c index c2b0b443877..79e46c0fbca 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c @@ -243,7 +243,6 @@ struct lp_build_nir_soa_context */ LLVMValueRef inputs_array; - LLVMValueRef kernel_args_ptr; unsigned gs_vertex_streams; LLVMTypeRef call_context_type; @@ -4537,42 +4536,6 @@ visit_discard(struct lp_build_nir_soa_context *bld, lp_build_mask_update(bld->mask, mask); } -static void -visit_load_kernel_input(struct lp_build_nir_soa_context *bld, - nir_intrinsic_instr *instr, - LLVMValueRef result[NIR_MAX_VEC_COMPONENTS]) -{ - struct gallivm_state *gallivm = bld->base.gallivm; - LLVMBuilderRef builder = gallivm->builder; - - LLVMValueRef offset = get_src(bld, &instr->src[0], 0); - bool offset_is_uniform = !lp_nir_instr_src_divergent(&instr->instr, 0); - - struct lp_build_context *bld_broad = get_int_bld(bld, true, instr->def.bit_size, !offset_is_uniform); - LLVMValueRef kernel_args_ptr = bld->kernel_args_ptr; - unsigned size_shift = bit_size_to_shift_size(instr->def.bit_size); - struct lp_build_context *bld_offset = get_int_bld(bld, true, nir_src_bit_size(instr->src[0]), !offset_is_uniform); - if (size_shift) - offset = lp_build_shr(bld_offset, offset, lp_build_const_int_vec(gallivm, bld_offset->type, size_shift)); - - LLVMTypeRef ptr_type = LLVMPointerType(bld_broad->elem_type, 0); - kernel_args_ptr = LLVMBuildBitCast(builder, kernel_args_ptr, ptr_type, ""); - - if (offset_is_uniform) { - offset = LLVMBuildExtractElement(builder, offset, first_active_invocation(bld), ""); - - for (unsigned c = 0; c < instr->def.num_components; c++) { - LLVMValueRef this_offset = LLVMBuildAdd(builder, offset, nir_src_bit_size(instr->src[0]) == 64 ? - lp_build_const_int64(gallivm, c) : - lp_build_const_int32(gallivm, c), ""); - - result[c] = lp_build_pointer_get2(builder, bld_broad->elem_type, kernel_args_ptr, this_offset); - } - } else { - unreachable("load_kernel_arg must have a uniform offset."); - } -} - static void visit_load_global(struct lp_build_nir_soa_context *bld, nir_intrinsic_instr *instr, @@ -5046,9 +5009,6 @@ visit_intrinsic(struct lp_build_nir_soa_context *bld, case nir_intrinsic_barrier: visit_barrier(bld, instr); break; - case nir_intrinsic_load_kernel_input: - visit_load_kernel_input(bld, instr, result); - break; case nir_intrinsic_load_global: case nir_intrinsic_load_global_constant: visit_load_global(bld, instr, result); @@ -5910,7 +5870,6 @@ void lp_build_nir_soa_func(struct gallivm_state *gallivm, bld.shared_ptr = params->shared_ptr; bld.payload_ptr = params->payload_ptr; bld.coro = params->coro; - bld.kernel_args_ptr = params->kernel_args; bld.num_inputs = params->num_inputs; bld.indirects = 0; if (shader->info.inputs_read_indirectly) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h index 28bfa0374ad..209d1f9fcd0 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h @@ -286,7 +286,6 @@ struct lp_build_tgsi_params { LLVMValueRef shared_ptr; LLVMValueRef payload_ptr; const struct lp_build_coro_suspend_info *coro; - LLVMValueRef kernel_args; const struct lp_build_fs_iface *fs_iface; unsigned gs_vertex_streams; LLVMValueRef current_func; diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index 851772f7be2..ae193b6d408 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -270,15 +270,11 @@ lp_jit_create_cs_types(struct lp_compute_shader_variant *lp) LLVMTypeRef elem_types[LP_JIT_CS_CTX_COUNT]; LLVMTypeRef cs_context_type; - elem_types[LP_JIT_CS_CTX_KERNEL_ARGS] = LLVMPointerType(LLVMInt8TypeInContext(lc), 0); elem_types[LP_JIT_CS_CTX_SHARED_SIZE] = LLVMInt32TypeInContext(lc); cs_context_type = LLVMStructTypeInContext(lc, elem_types, ARRAY_SIZE(elem_types), 0); - LP_CHECK_MEMBER_OFFSET(struct lp_jit_cs_context, kernel_args, - gallivm->target, cs_context_type, - LP_JIT_CS_CTX_KERNEL_ARGS); LP_CHECK_MEMBER_OFFSET(struct lp_jit_cs_context, shared_size, gallivm->target, cs_context_type, LP_JIT_CS_CTX_SHARED_SIZE); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index 672a42a103f..b672ad9b080 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -323,8 +323,6 @@ enum { struct lp_jit_cs_context { - const void *kernel_args; - uint32_t shared_size; }; @@ -333,7 +331,6 @@ struct lp_jit_cs_context * lp_jit_context struct above. */ enum { - LP_JIT_CS_CTX_KERNEL_ARGS, LP_JIT_CS_CTX_SHARED_SIZE, LP_JIT_CS_CTX_COUNT }; @@ -353,9 +350,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_kernel_args(_gallivm, _type, _ptr) \ - lp_build_struct_get2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_KERNEL_ARGS, "kernel_args") - #define lp_jit_cs_context_shared_size(_gallivm, _type, _ptr) \ lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_SHARED_SIZE, "shared_size") diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index b935c788bf9..3f1ab5f14f6 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -743,16 +743,12 @@ generate_compute(struct llvmpipe_context *lp, LLVMValueRef ssbo_ptr; LLVMValueRef shared_ptr; LLVMValueRef payload_ptr; - LLVMValueRef kernel_args_ptr; struct lp_build_mask_context mask; struct lp_bld_tgsi_system_values system_values; memset(&system_values, 0, sizeof(system_values)); consts_ptr = lp_jit_resources_constants(gallivm, variant->jit_resources_type, resources_ptr); ssbo_ptr = lp_jit_resources_ssbos(gallivm, variant->jit_resources_type, resources_ptr); - kernel_args_ptr = lp_jit_cs_context_kernel_args(gallivm, - variant->jit_cs_context_type, - context_ptr); shared_ptr = lp_jit_cs_thread_data_shared(gallivm, variant->jit_cs_thread_data_type, @@ -879,7 +875,6 @@ generate_compute(struct llvmpipe_context *lp, params.shared_ptr = shared_ptr; params.payload_ptr = payload_ptr; params.coro = &coro_info; - params.kernel_args = kernel_args_ptr; params.mesh_iface = &mesh_iface.base; params.current_func = NULL; @@ -1643,7 +1638,7 @@ update_csctx_ssbo(struct llvmpipe_context *llvmpipe, static void -llvmpipe_cs_update_derived(struct llvmpipe_context *llvmpipe, const void *input) +llvmpipe_cs_update_derived(struct llvmpipe_context *llvmpipe) { if (llvmpipe->cs_dirty & LP_CSNEW_CONSTANTS) { lp_csctx_set_cs_constants(llvmpipe->csctx, @@ -1674,12 +1669,6 @@ llvmpipe_cs_update_derived(struct llvmpipe_context *llvmpipe, const void *input) ARRAY_SIZE(llvmpipe->images[PIPE_SHADER_COMPUTE]), llvmpipe->images[PIPE_SHADER_COMPUTE]); - struct lp_cs_context *csctx = llvmpipe->csctx; - if (input) { - csctx->input = input; - csctx->cs.current.jit_context.kernel_args = input; - } - if (llvmpipe->cs_dirty & (LP_CSNEW_CS | LP_CSNEW_IMAGES | LP_CSNEW_SAMPLER_VIEW | @@ -1790,7 +1779,7 @@ llvmpipe_launch_grid(struct pipe_context *pipe, memset(&job_info, 0, sizeof(job_info)); - llvmpipe_cs_update_derived(llvmpipe, info->input); + llvmpipe_cs_update_derived(llvmpipe); fill_grid_size(pipe, 0, info, job_info.grid_size); @@ -1819,14 +1808,6 @@ llvmpipe_launch_grid(struct pipe_context *pipe, } -static void -llvmpipe_set_compute_resources(struct pipe_context *pipe, - unsigned start, unsigned count, - struct pipe_surface **resources) -{ -} - - static void llvmpipe_set_global_binding(struct pipe_context *pipe, unsigned first, unsigned count, @@ -1873,7 +1854,6 @@ llvmpipe_init_compute_funcs(struct llvmpipe_context *llvmpipe) llvmpipe->pipe.bind_compute_state = llvmpipe_bind_compute_state; llvmpipe->pipe.get_compute_state_info = llvmpipe_get_compute_state_info; llvmpipe->pipe.delete_compute_state = llvmpipe_delete_compute_state; - llvmpipe->pipe.set_compute_resources = llvmpipe_set_compute_resources; llvmpipe->pipe.set_global_binding = llvmpipe_set_global_binding; llvmpipe->pipe.launch_grid = llvmpipe_launch_grid; }