mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 11:30:21 +01:00
radv,aco: rename radv_aco_build_prolog to radv_aco_build_shader_part
Will be re-used for PS epilogs. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
This commit is contained in:
parent
897561b7b9
commit
df8fb721a5
3 changed files with 29 additions and 28 deletions
|
|
@ -274,7 +274,7 @@ aco_compile_vs_prolog(const struct aco_compiler_options* options,
|
|||
const struct aco_shader_info* info,
|
||||
const struct aco_vs_prolog_key* key,
|
||||
const struct radv_shader_args* args,
|
||||
aco_prolog_callback *build_prolog,
|
||||
aco_shader_part_callback *build_prolog,
|
||||
void **binary)
|
||||
{
|
||||
aco::init();
|
||||
|
|
|
|||
|
|
@ -58,14 +58,14 @@ typedef void (aco_callback)(void **priv_ptr,
|
|||
const uint32_t *code,
|
||||
uint32_t code_dw);
|
||||
|
||||
typedef void (aco_prolog_callback)(void **priv_ptr,
|
||||
uint32_t num_sgprs,
|
||||
uint32_t num_vgprs,
|
||||
uint32_t num_preserved_sgprs,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size,
|
||||
const char *disasm_str,
|
||||
uint32_t disasm_size);
|
||||
typedef void (aco_shader_part_callback)(void **priv_ptr,
|
||||
uint32_t num_sgprs,
|
||||
uint32_t num_vgprs,
|
||||
uint32_t num_preserved_sgprs,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size,
|
||||
const char *disasm_str,
|
||||
uint32_t disasm_size);
|
||||
|
||||
extern const unsigned aco_num_statistics;
|
||||
extern const struct aco_compiler_statistic_info* aco_statistic_infos;
|
||||
|
|
@ -81,7 +81,7 @@ void aco_compile_vs_prolog(const struct aco_compiler_options* options,
|
|||
const struct aco_shader_info* info,
|
||||
const struct aco_vs_prolog_key* key,
|
||||
const struct radv_shader_args* args,
|
||||
aco_prolog_callback *build_prolog,
|
||||
aco_shader_part_callback *build_prolog,
|
||||
void **binary);
|
||||
|
||||
uint64_t aco_get_codegen_flags();
|
||||
|
|
|
|||
|
|
@ -2352,33 +2352,33 @@ upload_shader_part(struct radv_device *device, struct radv_shader_part_binary *b
|
|||
return shader_part;
|
||||
}
|
||||
|
||||
static void radv_aco_build_prolog(void **bin,
|
||||
uint32_t num_sgprs,
|
||||
uint32_t num_vgprs,
|
||||
uint32_t num_preserved_sgprs,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size,
|
||||
const char *disasm_str,
|
||||
uint32_t disasm_size)
|
||||
static void radv_aco_build_shader_part(void **bin,
|
||||
uint32_t num_sgprs,
|
||||
uint32_t num_vgprs,
|
||||
uint32_t num_preserved_sgprs,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size,
|
||||
const char *disasm_str,
|
||||
uint32_t disasm_size)
|
||||
{
|
||||
struct radv_shader_part_binary **binary = (struct radv_shader_part_binary **)bin;
|
||||
size_t size = code_size * sizeof(uint32_t) + sizeof(struct radv_shader_part_binary);
|
||||
|
||||
size += disasm_size;
|
||||
struct radv_shader_part_binary *prolog_binary = (struct radv_shader_part_binary *)calloc(size, 1);
|
||||
struct radv_shader_part_binary *part_binary = (struct radv_shader_part_binary *)calloc(size, 1);
|
||||
|
||||
prolog_binary->num_sgprs = num_sgprs;
|
||||
prolog_binary->num_vgprs = num_vgprs;
|
||||
prolog_binary->num_preserved_sgprs = num_preserved_sgprs;
|
||||
prolog_binary->code_size = code_size * sizeof(uint32_t);
|
||||
memcpy(prolog_binary->data, code, prolog_binary->code_size);
|
||||
part_binary->num_sgprs = num_sgprs;
|
||||
part_binary->num_vgprs = num_vgprs;
|
||||
part_binary->num_preserved_sgprs = num_preserved_sgprs;
|
||||
part_binary->code_size = code_size * sizeof(uint32_t);
|
||||
memcpy(part_binary->data, code, part_binary->code_size);
|
||||
if (disasm_size) {
|
||||
memcpy((char*)prolog_binary->data + prolog_binary->code_size,
|
||||
memcpy((char*)part_binary->data + part_binary->code_size,
|
||||
disasm_str, disasm_size);
|
||||
prolog_binary->disasm_size = disasm_size;
|
||||
part_binary->disasm_size = disasm_size;
|
||||
}
|
||||
|
||||
*binary = prolog_binary;
|
||||
*binary = part_binary;
|
||||
}
|
||||
|
||||
struct radv_shader_part *
|
||||
|
|
@ -2425,7 +2425,8 @@ radv_create_vs_prolog(struct radv_device *device, const struct radv_vs_prolog_ke
|
|||
radv_aco_convert_shader_info(&ac_info, &info);
|
||||
radv_aco_convert_opts(&ac_opts, &options);
|
||||
radv_aco_convert_vs_prolog_key(&ac_key, key);
|
||||
aco_compile_vs_prolog(&ac_opts, &ac_info, &ac_key, &args, &radv_aco_build_prolog, (void **)&binary);
|
||||
aco_compile_vs_prolog(&ac_opts, &ac_info, &ac_key, &args, &radv_aco_build_shader_part,
|
||||
(void **)&binary);
|
||||
struct radv_shader_part *prolog = upload_shader_part(device, binary, info.wave_size);
|
||||
if (prolog) {
|
||||
prolog->nontrivial_divisors = key->state->nontrivial_divisors;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue