mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
aco/radv: convert to aco shader info at the radv level.
This removes the radv shader info type from aco completely. Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16342>
This commit is contained in:
parent
199edce84d
commit
04c07a2413
11 changed files with 33 additions and 32 deletions
|
|
@ -11294,7 +11294,7 @@ ngg_emit_sendmsg_gs_alloc_req(isel_context* ctx, Temp vtx_cnt, Temp prm_cnt)
|
|||
void
|
||||
select_program(Program* program, unsigned shader_count, struct nir_shader* const* shaders,
|
||||
ac_shader_config* config, const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args)
|
||||
{
|
||||
isel_context ctx = setup_isel_context(program, shader_count, shaders, config, options, info, args, false);
|
||||
|
|
@ -11422,7 +11422,7 @@ select_program(Program* program, unsigned shader_count, struct nir_shader* const
|
|||
void
|
||||
select_gs_copy_shader(Program* program, struct nir_shader* gs_shader, ac_shader_config* config,
|
||||
const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args)
|
||||
{
|
||||
isel_context ctx = setup_isel_context(program, 1, &gs_shader, config, options, info, args, true);
|
||||
|
|
@ -11521,7 +11521,7 @@ select_gs_copy_shader(Program* program, struct nir_shader* gs_shader, ac_shader_
|
|||
void
|
||||
select_trap_handler_shader(Program* program, struct nir_shader* shader, ac_shader_config* config,
|
||||
const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args)
|
||||
{
|
||||
assert(options->chip_class == GFX8);
|
||||
|
|
@ -11685,7 +11685,7 @@ calc_nontrivial_instance_id(Builder& bld, const struct radv_shader_args* args, u
|
|||
void
|
||||
select_vs_prolog(Program* program, const struct radv_vs_prolog_key* key, ac_shader_config* config,
|
||||
const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args, unsigned* num_preserved_sgprs)
|
||||
{
|
||||
assert(key->num_attributes > 0);
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ void cleanup_context(isel_context* ctx);
|
|||
isel_context setup_isel_context(Program* program, unsigned shader_count,
|
||||
struct nir_shader* const* shaders, ac_shader_config* config,
|
||||
const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args, bool is_gs_copy_shader);
|
||||
|
||||
} // namespace aco
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ cleanup_context(isel_context* ctx)
|
|||
isel_context
|
||||
setup_isel_context(Program* program, unsigned shader_count, struct nir_shader* const* shaders,
|
||||
ac_shader_config* config, const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args, bool is_gs_copy_shader)
|
||||
{
|
||||
SWStage sw_stage = SWStage::None;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ get_disasm_string(aco::Program* program, std::vector<uint32_t>& code,
|
|||
|
||||
void
|
||||
aco_compile_shader(const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
unsigned shader_count, struct nir_shader* const* shaders,
|
||||
const struct radv_shader_args *args,
|
||||
struct radv_shader_binary** binary)
|
||||
|
|
@ -280,7 +280,7 @@ aco_compile_shader(const struct radv_nir_compiler_options* options,
|
|||
|
||||
void
|
||||
aco_compile_vs_prolog(const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_vs_prolog_key* key,
|
||||
const struct radv_shader_args* args,
|
||||
struct radv_prolog_binary** binary)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
struct ac_shader_config;
|
||||
struct aco_shader_info;
|
||||
|
||||
struct aco_compiler_statistic_info {
|
||||
char name[32];
|
||||
|
|
@ -42,13 +43,13 @@ extern const unsigned aco_num_statistics;
|
|||
extern const struct aco_compiler_statistic_info* aco_statistic_infos;
|
||||
|
||||
void aco_compile_shader(const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
unsigned shader_count, struct nir_shader* const* shaders,
|
||||
const struct radv_shader_args *args,
|
||||
struct radv_shader_binary** binary);
|
||||
|
||||
void aco_compile_vs_prolog(const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_vs_prolog_key* key,
|
||||
const struct radv_shader_args* args,
|
||||
struct radv_prolog_binary** binary);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "vulkan/radv_aco_shader_info.h"
|
||||
|
||||
namespace aco {
|
||||
|
||||
uint64_t debug_flags = 0;
|
||||
|
|
@ -67,13 +65,13 @@ init()
|
|||
}
|
||||
|
||||
void
|
||||
init_program(Program* program, Stage stage, const struct radv_shader_info* info,
|
||||
init_program(Program* program, Stage stage, const struct aco_shader_info* info,
|
||||
enum chip_class chip_class, enum radeon_family family, bool wgp_mode,
|
||||
ac_shader_config* config)
|
||||
{
|
||||
program->stage = stage;
|
||||
program->config = config;
|
||||
radv_aco_convert_shader_info(&program->info, info);
|
||||
program->info = *info;
|
||||
program->chip_class = chip_class;
|
||||
if (family == CHIP_UNKNOWN) {
|
||||
switch (chip_class) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include <vector>
|
||||
|
||||
struct radv_shader_args;
|
||||
struct radv_shader_info;
|
||||
struct radv_vs_prolog_key;
|
||||
|
||||
namespace aco {
|
||||
|
|
@ -2152,27 +2151,27 @@ struct ra_test_policy {
|
|||
|
||||
void init();
|
||||
|
||||
void init_program(Program* program, Stage stage, const struct radv_shader_info* info,
|
||||
void init_program(Program* program, Stage stage, const struct aco_shader_info* info,
|
||||
enum chip_class chip_class, enum radeon_family family, bool wgp_mode,
|
||||
ac_shader_config* config);
|
||||
|
||||
void select_program(Program* program, unsigned shader_count, struct nir_shader* const* shaders,
|
||||
ac_shader_config* config, const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args);
|
||||
void select_gs_copy_shader(Program* program, struct nir_shader* gs_shader, ac_shader_config* config,
|
||||
const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args);
|
||||
void select_trap_handler_shader(Program* program, struct nir_shader* shader,
|
||||
ac_shader_config* config,
|
||||
const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args);
|
||||
void select_vs_prolog(Program* program, const struct radv_vs_prolog_key* key,
|
||||
ac_shader_config* config,
|
||||
const struct radv_nir_compiler_options* options,
|
||||
const struct radv_shader_info* info,
|
||||
const struct aco_shader_info* info,
|
||||
const struct radv_shader_args* args,
|
||||
unsigned* num_preserved_sgprs);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,14 @@
|
|||
#define ACO_SHADER_INFO_H
|
||||
|
||||
#include "shader_enums.h"
|
||||
/* temporary */
|
||||
#include "vulkan/radv_shader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ACO_MAX_SO_OUTPUTS 64
|
||||
#define ACO_MAX_SO_BUFFERS 4
|
||||
|
||||
struct aco_vp_output_info {
|
||||
uint8_t vs_output_param_offset[VARYING_SLOT_MAX];
|
||||
uint8_t clip_dist_mask;
|
||||
|
|
@ -63,8 +64,8 @@ struct aco_stream_output {
|
|||
|
||||
struct aco_streamout_info {
|
||||
uint16_t num_outputs;
|
||||
struct aco_stream_output outputs[MAX_SO_OUTPUTS];
|
||||
uint16_t strides[MAX_SO_BUFFERS];
|
||||
struct aco_stream_output outputs[ACO_MAX_SO_OUTPUTS];
|
||||
uint16_t strides[ACO_MAX_SO_BUFFERS];
|
||||
};
|
||||
|
||||
struct aco_shader_info {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(
|
|||
}
|
||||
|
||||
ac_shader_config config;
|
||||
radv_shader_info info;
|
||||
aco_shader_info info;
|
||||
std::unique_ptr<Program> program;
|
||||
Builder bld(NULL);
|
||||
Temp inputs[16];
|
||||
|
|
@ -106,10 +106,6 @@ bool setup_cs(const char *input_spec, enum chip_class chip_class,
|
|||
return false;
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
info.cs.block_size[0] = 1;
|
||||
info.cs.block_size[1] = 1;
|
||||
info.cs.block_size[2] = 1;
|
||||
|
||||
create_program(chip_class, compute_cs, wave_size, family);
|
||||
|
||||
if (input_spec) {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ struct QoShaderModuleCreateInfo {
|
|||
};
|
||||
|
||||
extern ac_shader_config config;
|
||||
extern radv_shader_info info;
|
||||
extern aco_shader_info info;
|
||||
extern std::unique_ptr<aco::Program> program;
|
||||
extern aco::Builder bld;
|
||||
extern aco::Temp inputs[16];
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
#include "sid.h"
|
||||
#include "vk_format.h"
|
||||
|
||||
#include "aco_shader_info.h"
|
||||
#include "radv_aco_shader_info.h"
|
||||
#ifdef LLVM_AVAILABLE
|
||||
#include "ac_llvm_util.h"
|
||||
#endif
|
||||
|
|
@ -1988,7 +1990,9 @@ shader_compile(struct radv_device *device, struct nir_shader *const *shaders, in
|
|||
if (false) {
|
||||
#endif
|
||||
} else {
|
||||
aco_compile_shader(options, info, shader_count, shaders, args, &binary);
|
||||
struct aco_shader_info ac_info;
|
||||
radv_aco_convert_shader_info(&ac_info, info);
|
||||
aco_compile_shader(options, &ac_info, shader_count, shaders, args, &binary);
|
||||
}
|
||||
|
||||
binary->info = *info;
|
||||
|
|
@ -2181,7 +2185,9 @@ radv_create_vs_prolog(struct radv_device *device, const struct radv_vs_prolog_ke
|
|||
#endif
|
||||
|
||||
struct radv_prolog_binary *binary = NULL;
|
||||
aco_compile_vs_prolog(&options, &info, key, &args, &binary);
|
||||
struct aco_shader_info ac_info;
|
||||
radv_aco_convert_shader_info(&ac_info, &info);
|
||||
aco_compile_vs_prolog(&options, &ac_info, key, &args, &binary);
|
||||
struct radv_shader_prolog *prolog = upload_vs_prolog(device, binary, info.wave_size);
|
||||
if (prolog) {
|
||||
prolog->nontrivial_divisors = key->state->nontrivial_divisors;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue