radv: keep track of the number of remaining user SGPRs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 5 Feb 2019 19:22:00 +0000 (20:22 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 12 Feb 2019 16:25:52 +0000 (17:25 +0100)
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 dbeae2aafde3b0eb2cb4584ebab7c8a68c157412..29300aeab9f81286b51636c543659627787c28e0 100644 (file)
@@ -588,6 +588,7 @@ set_loc_desc(struct radv_shader_context *ctx, int idx, uint8_t *sgpr_idx)
 struct user_sgpr_info {
        bool need_ring_offsets;
        bool indirect_all_descriptor_sets;
+       uint8_t remaining_sgprs;
 };
 
 static bool needs_view_index_sgpr(struct radv_shader_context *ctx,
@@ -701,6 +702,9 @@ static void allocate_user_sgprs(struct radv_shader_context *ctx,
 
        if (remaining_sgprs < num_desc_set) {
                user_sgpr_info->indirect_all_descriptor_sets = true;
+               user_sgpr_info->remaining_sgprs = remaining_sgprs - 1;
+       } else {
+               user_sgpr_info->remaining_sgprs = remaining_sgprs - num_desc_set;
        }
 }