radv: fix computation of user sgprs for 32-bit pointers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 21 May 2018 14:57:54 +0000 (16:57 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 22 May 2018 13:53:29 +0000 (15:53 +0200)
With 32-bit pointers we only need one user SGPR per desc set.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_nir_to_llvm.c

index 39692e99fd980b4213e6af1392138da059b7dd48..b174c027d959c2df35f86ece4c58f87b9c91ab42 100644 (file)
@@ -694,8 +694,10 @@ static void allocate_user_sgprs(struct radv_shader_context *ctx,
 
        uint32_t available_sgprs = ctx->options->chip_class >= GFX9 ? 32 : 16;
        uint32_t remaining_sgprs = available_sgprs - user_sgpr_count;
+       uint32_t num_desc_set =
+               util_bitcount(ctx->shader_info->info.desc_set_used_mask);
 
-       if (remaining_sgprs / 2 < util_bitcount(ctx->shader_info->info.desc_set_used_mask)) {
+       if (remaining_sgprs / (HAVE_32BIT_POINTERS ? 1 : 2) < num_desc_set) {
                user_sgpr_info->indirect_all_descriptor_sets = true;
        }
 }