Commit 601b7684 authored by Marek Olšák's avatar Marek Olšák
Browse files

aco experiment

This won't be pushed.
parent 94dfaa2c
Pipeline #239383 waiting for manual action with stages
in 55 seconds
This commit is part of merge request !7939. Comments created here will be created in the context of that merge request.
......@@ -31,6 +31,8 @@ extern "C" {
#endif
struct ac_shader_config;
struct radv_shader_binary;
struct radv_shader_args;
struct aco_compiler_statistic_info {
char name[32];
......
......@@ -34,11 +34,11 @@
#include "amd_family.h"
#include "radv_constants.h"
#include "nir/nir.h"
#include "nir.h"
#include "vulkan/vulkan.h"
#include "vulkan/util/vk_object.h"
#include "aco_interface.h"
#include "amd/compiler/aco_interface.h"
#define RADV_VERT_ATTRIB_MAX MAX2(VERT_ATTRIB_MAX, VERT_ATTRIB_GENERIC0 + MAX_VERTEX_ATTRIBS)
......
......@@ -104,7 +104,7 @@ libradeonsi = static_library(
],
c_args : ['-Wstrict-overflow=0'],
gnu_symbol_visibility : 'hidden',
dependencies : [dep_llvm, dep_clock, dep_libdrm_radeon, idep_nir_headers, idep_amdgfxregs_h, idep_mesautil],
dependencies : [dep_llvm, dep_clock, dep_libdrm_radeon, idep_nir_headers, idep_amdgfxregs_h, idep_mesautil, idep_aco],
)
driver_radeonsi = declare_dependency(
......
......@@ -32,6 +32,10 @@
#include "tgsi/tgsi_from_mesa.h"
#include "tgsi/tgsi_strings.h"
#include "util/u_memory.h"
#include "amd/compiler/aco_interface.h"
#include "amd/vulkan/radv_descriptor_set.h"
#include "amd/vulkan/radv_shader_args.h"
#include "amd/vulkan/radv_shader.h"
static const char scratch_rsrc_dword0_symbol[] = "SCRATCH_RSRC_DWORD0";
......@@ -1447,6 +1451,37 @@ bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compi
* with PS and NGG VS), but monolithic shaders should be compiled
* by LLVM due to more complicated compilation.
*/
if (debug_get_bool_option("ACO", false) && nir->info.stage == MESA_SHADER_VERTEX) {
struct radv_shader_binary binary = {};
struct radv_shader_binary *pbinary = &binary;
struct radv_shader_args args = {};
struct radv_shader_info info = {};
struct radv_nir_compiler_options options = {};
struct radv_pipeline_layout layout = {};
si_init_shader_args(shader, &args.ac, false);
Please register or sign in to reply
options.chip_class = sscreen->info.chip_class;
options.family = sscreen->info.family;
options.address32_hi = sscreen->info.address32_hi;
options.layout = &layout;
options.key.vs.out.as_es = shader->key.as_es;
options.key.vs.out.as_ls = shader->key.as_ls;
info.is_ngg = options.key.vs.out.as_ngg = shader->key.as_ngg;
info.is_ngg_passthrough = options.key.vs.out.as_ngg_passthrough = info.is_ngg;
info.ngg_info.hw_max_esverts = 128;
info.ngg_info.max_gsprims = 128;
info.wave_size = si_get_shader_wave_size(shader);
args.shader_info = &info;
args.options = &options;
aco_compile_shader(1, &nir, &pbinary, &args);
}
if (!si_llvm_compile_shader(sscreen, compiler, shader, debug, nir, free_nir))
return false;
......
......@@ -713,7 +713,7 @@ struct si_shader_binary {
char *llvm_ir_string;
};
struct gfx9_gs_info {
struct si_gfx9_gs_info {
unsigned es_verts_per_subgroup;
unsigned gs_prims_per_subgroup;
unsigned gs_inst_prims_in_subgroup;
......@@ -770,7 +770,7 @@ struct si_shader {
char *shader_log;
size_t shader_log_size;
struct gfx9_gs_info gs_info;
struct si_gfx9_gs_info gs_info;
/* For save precompute context registers values. */
union {
......@@ -872,7 +872,7 @@ void si_finalize_nir(struct pipe_screen *screen, void *nirptr, bool optimize);
/* si_state_shaders.c */
void gfx9_get_gs_info(struct si_shader_selector *es, struct si_shader_selector *gs,
struct gfx9_gs_info *out);
struct si_gfx9_gs_info *out);
/* Inline helpers. */
......
......@@ -634,7 +634,7 @@ static void si_shader_es(struct si_screen *sscreen, struct si_shader *shader)
}
void gfx9_get_gs_info(struct si_shader_selector *es, struct si_shader_selector *gs,
struct gfx9_gs_info *out)
struct si_gfx9_gs_info *out)
{
unsigned gs_num_invocations = MAX2(gs->info.base.gs.invocations, 1);
unsigned input_prim = gs->info.base.gs.input_primitive;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment