diff options
Diffstat (limited to 'src/amd/compiler/aco_instruction_selection_setup.cpp')
-rw-r--r-- | src/amd/compiler/aco_instruction_selection_setup.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/amd/compiler/aco_instruction_selection_setup.cpp b/src/amd/compiler/aco_instruction_selection_setup.cpp index d7a193552ba..0104fd36f49 100644 --- a/src/amd/compiler/aco_instruction_selection_setup.cpp +++ b/src/amd/compiler/aco_instruction_selection_setup.cpp @@ -1192,10 +1192,8 @@ setup_variables(isel_context *ctx, nir_shader *nir) break; } case MESA_SHADER_COMPUTE: { - unsigned lds_allocation_size_unit = 4 * 64; - if (ctx->program->chip_class >= GFX7) - lds_allocation_size_unit = 4 * 128; - ctx->program->config->lds_size = (nir->info.cs.shared_size + lds_allocation_size_unit - 1) / lds_allocation_size_unit; + ctx->program->config->lds_size = (nir->info.cs.shared_size + ctx->program->lds_alloc_granule - 1) / + ctx->program->lds_alloc_granule; break; } case MESA_SHADER_VERTEX: { @@ -1255,6 +1253,9 @@ setup_isel_context(Program* program, program->family = options->family; program->wave_size = options->wave_size; + program->lds_alloc_granule = options->chip_class >= GFX7 ? 512 : 256; + program->lds_limit = options->chip_class >= GFX7 ? 65536 : 32768; + if (options->chip_class >= GFX10) { program->physical_sgprs = 2560; /* doesn't matter as long as it's at least 128 * 20 */ program->sgpr_alloc_granule = 127; |