mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 03:10:41 +02:00
ac/llvm: add ac_get_ptr_arg
For argument of type AC_AR_..._PTR, this returns a ac_llvm_pointer. Reviewed-by: Qiang Yu <yuq825@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19035>
This commit is contained in:
parent
39fd373f81
commit
efa5c52822
1 changed files with 6 additions and 3 deletions
|
|
@ -601,10 +601,13 @@ static inline LLVMValueRef ac_get_arg(struct ac_llvm_context *ctx, struct ac_arg
|
|||
return LLVMGetParam(ctx->main_function.value, arg.arg_index);
|
||||
}
|
||||
|
||||
static inline LLVMTypeRef ac_get_arg_pointee_type(struct ac_llvm_context *ctx, const struct ac_shader_args *args, struct ac_arg arg)
|
||||
static inline struct ac_llvm_pointer
|
||||
ac_get_ptr_arg(struct ac_llvm_context *ctx, const struct ac_shader_args *args, struct ac_arg arg)
|
||||
{
|
||||
assert(arg.used);
|
||||
return ac_arg_type_to_pointee_type(ctx, args->args[arg.arg_index].type);
|
||||
struct ac_llvm_pointer ptr;
|
||||
ptr.pointee_type = ac_arg_type_to_pointee_type(ctx, args->args[arg.arg_index].type);
|
||||
ptr.value = LLVMGetParam(ctx->main_function.value, arg.arg_index);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
enum ac_llvm_calling_convention
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue