xref: /aosp_15_r20/external/mesa3d/src/amd/llvm/ac_nir_to_llvm.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2016 Bas Nieuwenhuizen
3  *
4  * SPDX-License-Identifier: MIT
5  */
6 
7 #ifndef AC_NIR_TO_LLVM_H
8 #define AC_NIR_TO_LLVM_H
9 
10 #include "amd_family.h"
11 #include "compiler/shader_enums.h"
12 #include <llvm-c/Core.h>
13 #include "llvm-c/TargetMachine.h"
14 
15 #include <stdbool.h>
16 
17 struct nir_shader;
18 struct nir_variable;
19 struct ac_llvm_context;
20 struct ac_shader_abi;
21 struct ac_shader_args;
22 
23 /* Interpolation locations */
24 #define INTERP_CENTER   0
25 #define INTERP_CENTROID 1
26 #define INTERP_SAMPLE   2
27 
ac_llvm_reg_index_soa(unsigned index,unsigned chan)28 static inline unsigned ac_llvm_reg_index_soa(unsigned index, unsigned chan)
29 {
30    return (index * 4) + chan;
31 }
32 
33 bool ac_nir_translate(struct ac_llvm_context *ac, struct ac_shader_abi *abi,
34                       const struct ac_shader_args *args, struct nir_shader *nir);
35 
36 void ac_fixup_ls_hs_input_vgprs(struct ac_llvm_context *ac, struct ac_shader_abi *abi,
37                                 const struct ac_shader_args *args);
38 
39 #endif /* AC_NIR_TO_LLVM_H */
40