ac/nir: count the scratch private memory size
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
3b8e7459f2
commit
7f6b91c9c3
|
@ -6800,7 +6800,8 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
|
||||||
struct nir_shader *const *shaders,
|
struct nir_shader *const *shaders,
|
||||||
int shader_count,
|
int shader_count,
|
||||||
struct ac_shader_variant_info *shader_info,
|
struct ac_shader_variant_info *shader_info,
|
||||||
const struct ac_nir_compiler_options *options)
|
const struct ac_nir_compiler_options *options,
|
||||||
|
bool dump_shader)
|
||||||
{
|
{
|
||||||
struct radv_shader_context ctx = {0};
|
struct radv_shader_context ctx = {0};
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
@ -6967,6 +6968,11 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
|
||||||
if (shader_count == 1)
|
if (shader_count == 1)
|
||||||
ac_nir_eliminate_const_vs_outputs(&ctx);
|
ac_nir_eliminate_const_vs_outputs(&ctx);
|
||||||
|
|
||||||
|
if (dump_shader) {
|
||||||
|
ctx.shader_info->private_mem_vgprs =
|
||||||
|
ac_count_scratch_private_memory(ctx.main_function);
|
||||||
|
}
|
||||||
|
|
||||||
return ctx.ac.module;
|
return ctx.ac.module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7160,7 +7166,7 @@ void ac_compile_nir_shader(LLVMTargetMachineRef tm,
|
||||||
{
|
{
|
||||||
|
|
||||||
LLVMModuleRef llvm_module = ac_translate_nir_to_llvm(tm, nir, nir_count, shader_info,
|
LLVMModuleRef llvm_module = ac_translate_nir_to_llvm(tm, nir, nir_count, shader_info,
|
||||||
options);
|
options, dump_shader);
|
||||||
|
|
||||||
ac_compile_llvm_module(tm, llvm_module, binary, config, shader_info, nir[0]->info.stage, dump_shader, options->supports_spill);
|
ac_compile_llvm_module(tm, llvm_module, binary, config, shader_info, nir[0]->info.stage, dump_shader, options->supports_spill);
|
||||||
for (int i = 0; i < nir_count; ++i)
|
for (int i = 0; i < nir_count; ++i)
|
||||||
|
|
|
@ -163,6 +163,7 @@ struct ac_shader_variant_info {
|
||||||
unsigned num_user_sgprs;
|
unsigned num_user_sgprs;
|
||||||
unsigned num_input_sgprs;
|
unsigned num_input_sgprs;
|
||||||
unsigned num_input_vgprs;
|
unsigned num_input_vgprs;
|
||||||
|
unsigned private_mem_vgprs;
|
||||||
bool need_indirect_descriptor_sets;
|
bool need_indirect_descriptor_sets;
|
||||||
struct {
|
struct {
|
||||||
struct {
|
struct {
|
||||||
|
|
Loading…
Reference in New Issue