From: Samuel Pitoiset Date: Thu, 12 Sep 2019 13:58:25 +0000 (+0200) Subject: radv: fix allocating number of user sgprs if streamout is used X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8137df3a46abc6aa6ad0c7179d042e76ca2b2299;p=mesa.git radv: fix allocating number of user sgprs if streamout is used streamout_buffers is assigned after that function, so the previous fix was completely wrong. This probably fix something when streamout buffers and push constants are used/inlined in the same shader. Fixes: 378e2d24143 ("radv: fix computing number of user SGPRs for streamout buffers") Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c index f7249913ec5..88c0c514eae 100644 --- a/src/amd/vulkan/radv_nir_to_llvm.c +++ b/src/amd/vulkan/radv_nir_to_llvm.c @@ -649,7 +649,7 @@ static void allocate_user_sgprs(struct radv_shader_context *ctx, if (ctx->shader_info->loads_push_constants) user_sgpr_count++; - if (ctx->streamout_buffers) + if (ctx->shader_info->so.num_outputs) user_sgpr_count++; uint32_t available_sgprs = ctx->options->chip_class >= GFX9 && stage != MESA_SHADER_COMPUTE ? 32 : 16;