2019-09-17 13:22:17 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright © 2018 Google
|
|
|
|
|
*
|
2024-04-08 09:02:30 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2019-09-17 13:22:17 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef ACO_INTERFACE_H
|
|
|
|
|
#define ACO_INTERFACE_H
|
|
|
|
|
|
2022-05-16 14:54:05 +10:00
|
|
|
#include "aco_shader_info.h"
|
2023-05-26 12:55:35 +01:00
|
|
|
|
2025-02-06 11:58:41 +01:00
|
|
|
#include "nir_defines.h"
|
2025-06-17 15:07:04 +01:00
|
|
|
#include "util/shader_stats.h"
|
2023-11-01 17:27:43 +08:00
|
|
|
|
2025-06-17 15:07:04 +01:00
|
|
|
#include "ac_shader_debug_info.h"
|
2022-05-16 14:54:05 +10:00
|
|
|
#include "amd_family.h"
|
2019-09-17 13:22:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-02-17 18:42:48 +01:00
|
|
|
struct nir_parameter;
|
|
|
|
|
typedef struct nir_parameter nir_parameter;
|
2019-09-17 13:22:17 +02:00
|
|
|
struct ac_shader_config;
|
2022-05-05 13:34:41 +10:00
|
|
|
struct aco_shader_info;
|
2023-03-03 11:25:21 -08:00
|
|
|
struct aco_vs_prolog_info;
|
|
|
|
|
struct aco_ps_epilog_info;
|
2023-10-18 18:52:23 +08:00
|
|
|
struct radeon_info;
|
2019-09-17 13:22:17 +02:00
|
|
|
|
2023-03-17 00:49:44 +01:00
|
|
|
typedef void(aco_callback)(void** priv_ptr, const struct ac_shader_config* config,
|
|
|
|
|
const char* llvm_ir_str, unsigned llvm_ir_size, const char* disasm_str,
|
2025-06-17 15:07:04 +01:00
|
|
|
unsigned disasm_size, struct amd_stats* stats, uint32_t exec_size,
|
|
|
|
|
const uint32_t* code, uint32_t code_dw, const struct aco_symbol* symbols,
|
|
|
|
|
unsigned num_symbols, const struct ac_shader_debug_info* debug_info,
|
|
|
|
|
unsigned debug_info_count);
|
2022-05-11 14:56:36 +10:00
|
|
|
|
2022-07-12 11:24:23 +02:00
|
|
|
typedef void(aco_shader_part_callback)(void** priv_ptr, uint32_t num_sgprs, uint32_t num_vgprs,
|
|
|
|
|
const uint32_t* code, uint32_t code_size,
|
|
|
|
|
const char* disasm_str, uint32_t disasm_size);
|
2022-05-11 14:56:36 +10:00
|
|
|
|
2022-05-16 14:54:05 +10:00
|
|
|
void aco_compile_shader(const struct aco_compiler_options* options,
|
2022-05-05 13:34:41 +10:00
|
|
|
const struct aco_shader_info* info, unsigned shader_count,
|
2021-10-08 16:14:15 +02:00
|
|
|
struct nir_shader* const* shaders, const struct ac_shader_args* args,
|
2022-05-11 14:48:07 +10:00
|
|
|
aco_callback* build_binary, void** binary);
|
2021-10-08 16:14:15 +02:00
|
|
|
|
2023-02-21 14:21:39 +01:00
|
|
|
void aco_compile_rt_prolog(const struct aco_compiler_options* options,
|
|
|
|
|
const struct aco_shader_info* info, const struct ac_shader_args* in_args,
|
2025-02-17 18:42:48 +01:00
|
|
|
const struct ac_arg* descriptors, unsigned raygen_param_count,
|
|
|
|
|
nir_parameter* raygen_params, aco_callback* build_prolog, void** binary);
|
2023-02-21 14:21:39 +01:00
|
|
|
|
2022-05-16 14:54:05 +10:00
|
|
|
void aco_compile_vs_prolog(const struct aco_compiler_options* options,
|
2022-05-05 13:34:41 +10:00
|
|
|
const struct aco_shader_info* info,
|
2023-03-03 11:25:21 -08:00
|
|
|
const struct aco_vs_prolog_info* prolog_info,
|
2023-03-03 11:47:02 -08:00
|
|
|
const struct ac_shader_args* args,
|
2023-03-03 11:25:21 -08:00
|
|
|
aco_shader_part_callback* build_prolog, void** binary);
|
2021-04-16 11:55:59 +01:00
|
|
|
|
2022-07-14 18:53:46 +02:00
|
|
|
void aco_compile_ps_epilog(const struct aco_compiler_options* options,
|
|
|
|
|
const struct aco_shader_info* info,
|
2023-03-03 11:25:21 -08:00
|
|
|
const struct aco_ps_epilog_info* epilog_info,
|
2023-03-03 11:47:02 -08:00
|
|
|
const struct ac_shader_args* args,
|
2023-03-03 11:25:21 -08:00
|
|
|
aco_shader_part_callback* build_epilog, void** binary);
|
2022-07-14 18:53:46 +02:00
|
|
|
|
2023-08-09 15:07:39 +08:00
|
|
|
void aco_compile_ps_prolog(const struct aco_compiler_options* options,
|
|
|
|
|
const struct aco_shader_info* info,
|
|
|
|
|
const struct aco_ps_prolog_info* pinfo,
|
|
|
|
|
const struct ac_shader_args* args,
|
|
|
|
|
aco_shader_part_callback* build_prolog, void** binary);
|
|
|
|
|
|
2024-11-08 14:22:05 +01:00
|
|
|
void aco_compile_trap_handler(const struct aco_compiler_options* options,
|
|
|
|
|
const struct aco_shader_info* info, const struct ac_shader_args* args,
|
|
|
|
|
aco_callback* build_binary, void** binary);
|
|
|
|
|
|
2022-01-18 14:53:38 +00:00
|
|
|
uint64_t aco_get_codegen_flags();
|
|
|
|
|
|
2023-10-18 18:52:23 +08:00
|
|
|
bool aco_is_gpu_supported(const struct radeon_info* info);
|
|
|
|
|
|
2023-11-10 19:23:45 -05:00
|
|
|
void aco_print_asm(const struct radeon_info *info, unsigned wave_size,
|
|
|
|
|
uint32_t *binary, unsigned num_dw);
|
|
|
|
|
|
2019-09-17 13:22:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|