xref: /aosp_15_r20/external/mesa3d/src/amd/common/ac_binary.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright 2014 Advanced Micro Devices, Inc.
3  *
4  * SPDX-License-Identifier: MIT
5  */
6 
7 #ifndef AC_BINARY_H
8 #define AC_BINARY_H
9 
10 #include <stdbool.h>
11 #include <stddef.h>
12 #include <stdint.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 struct radeon_info;
19 
20 struct ac_shader_config {
21    unsigned num_sgprs;
22    unsigned num_vgprs;
23    unsigned num_shared_vgprs; /* GFX10: number of VGPRs shared between half-waves */
24    unsigned spilled_sgprs;
25    unsigned spilled_vgprs;
26    unsigned lds_size; /* in HW allocation units; i.e 256 bytes on SI, 512 bytes on CI+ */
27    unsigned spi_ps_input_ena;
28    unsigned spi_ps_input_addr;
29    unsigned float_mode;
30    unsigned scratch_bytes_per_wave;
31    unsigned rsrc1;
32    unsigned rsrc2;
33    unsigned rsrc3;
34 };
35 
36 void ac_parse_shader_binary_config(const char *data, size_t nbytes, unsigned wave_size,
37                                    const struct radeon_info *info, struct ac_shader_config *conf);
38 
39 unsigned ac_align_shader_binary_for_prefetch(const struct radeon_info *info, unsigned size);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif /* AC_BINARY_H */
46