llvmpipe/cs: convert cs context to opaque friendly api
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Mihai Preda <mhpreda@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18837>
This commit is contained in:
@@ -486,6 +486,7 @@ lp_jit_create_cs_types(struct lp_compute_shader_variant *lp)
|
||||
LP_CHECK_STRUCT_SIZE(struct lp_jit_cs_context,
|
||||
gallivm->target, cs_context_type);
|
||||
|
||||
lp->jit_cs_context_type = cs_context_type;
|
||||
lp->jit_cs_context_ptr_type = LLVMPointerType(cs_context_type, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -461,29 +461,29 @@ enum {
|
||||
LP_JIT_CS_CTX_COUNT
|
||||
};
|
||||
|
||||
#define lp_jit_cs_context_constants(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CS_CTX_CONSTANTS, "constants")
|
||||
#define lp_jit_cs_context_constants(_gallivm, _type, _ptr) \
|
||||
lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_CONSTANTS, "constants")
|
||||
|
||||
#define lp_jit_cs_context_textures(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CS_CTX_TEXTURES, "textures")
|
||||
#define lp_jit_cs_context_textures(_gallivm, _type, _ptr) \
|
||||
lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_TEXTURES, "textures")
|
||||
|
||||
#define lp_jit_cs_context_samplers(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CS_CTX_SAMPLERS, "samplers")
|
||||
#define lp_jit_cs_context_samplers(_gallivm, _type, _ptr) \
|
||||
lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_SAMPLERS, "samplers")
|
||||
|
||||
#define lp_jit_cs_context_images(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CS_CTX_IMAGES, "images")
|
||||
#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_ssbos(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CS_CTX_SSBOS, "ssbos")
|
||||
#define lp_jit_cs_context_ssbos(_gallivm, _type, _ptr) \
|
||||
lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_CS_CTX_SSBOS, "ssbos")
|
||||
|
||||
#define lp_jit_cs_context_shared_size(_gallivm, _ptr) \
|
||||
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CS_CTX_SHARED_SIZE, "shared_size")
|
||||
#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")
|
||||
|
||||
#define lp_jit_cs_context_kernel_args(_gallivm, _ptr) \
|
||||
lp_build_struct_get(_gallivm, _ptr, LP_JIT_CS_CTX_KERNEL_ARGS, "kernel_args")
|
||||
#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_aniso_filter_table(_gallivm, _ptr) \
|
||||
lp_build_struct_get(_gallivm, _ptr, LP_JIT_CS_CTX_ANISO_FILTER_TABLE, "aniso_filter_table")
|
||||
#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")
|
||||
|
||||
|
||||
typedef void
|
||||
|
||||
@@ -327,9 +327,15 @@ generate_compute(struct llvmpipe_context *lp,
|
||||
struct lp_bld_tgsi_system_values system_values;
|
||||
|
||||
memset(&system_values, 0, sizeof(system_values));
|
||||
consts_ptr = lp_jit_cs_context_constants(gallivm, context_ptr);
|
||||
ssbo_ptr = lp_jit_cs_context_ssbos(gallivm, context_ptr);
|
||||
kernel_args_ptr = lp_jit_cs_context_kernel_args(gallivm, context_ptr);
|
||||
consts_ptr = lp_jit_cs_context_constants(gallivm,
|
||||
variant->jit_cs_context_type,
|
||||
context_ptr);
|
||||
ssbo_ptr = lp_jit_cs_context_ssbos(gallivm,
|
||||
variant->jit_cs_context_type,
|
||||
context_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, thread_data_ptr);
|
||||
|
||||
@@ -444,7 +450,9 @@ generate_compute(struct llvmpipe_context *lp,
|
||||
params.shared_ptr = shared_ptr;
|
||||
params.coro = &coro_info;
|
||||
params.kernel_args = kernel_args_ptr;
|
||||
params.aniso_filter_table = lp_jit_cs_context_aniso_filter_table(gallivm, context_ptr);
|
||||
params.aniso_filter_table = lp_jit_cs_context_aniso_filter_table(gallivm,
|
||||
variant->jit_cs_context_type,
|
||||
context_ptr);
|
||||
|
||||
if (shader->base.type == PIPE_SHADER_IR_TGSI)
|
||||
lp_build_tgsi_soa(gallivm, shader->base.tokens, ¶ms, NULL);
|
||||
|
||||
@@ -80,6 +80,7 @@ struct lp_compute_shader_variant
|
||||
{
|
||||
struct gallivm_state *gallivm;
|
||||
|
||||
LLVMTypeRef jit_cs_context_type;
|
||||
LLVMTypeRef jit_cs_context_ptr_type;
|
||||
LLVMTypeRef jit_cs_thread_data_ptr_type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user