amd/common: bump the number of available user SGPRS to 32 on GFX9
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 8 Jan 2018 14:19:34 +0000 (15:19 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 10 Jan 2018 11:35:08 +0000 (12:35 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 840d27e7a8ea7712df7542de3af3a25a8b6366ba..932d6480828d77224aa14692354f9fd061d78ee3 100644 (file)
@@ -600,7 +600,9 @@ static void allocate_user_sgprs(struct nir_to_llvm_context *ctx,
        if (ctx->shader_info->info.loads_push_constants)
                user_sgpr_info->sgpr_count += 2;
 
-       uint32_t remaining_sgprs = 16 - user_sgpr_info->sgpr_count;
+       uint32_t available_sgprs = ctx->options->chip_class >= GFX9 ? 32 : 16;
+       uint32_t remaining_sgprs = available_sgprs - user_sgpr_info->sgpr_count;
+
        if (remaining_sgprs / 2 < util_bitcount(ctx->shader_info->info.desc_set_used_mask)) {
                user_sgpr_info->sgpr_count += 2;
                user_sgpr_info->indirect_all_descriptor_sets = true;