Mesa (staging/19.2): radv: fix allocating number of user sgprs if streamout is used

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 13 17:09:12 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: e9d0589d26ca7a412e1dc53eca022f5edaa6d16e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9d0589d26ca7a412e1dc53eca022f5edaa6d16e

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Sep 12 15:58:25 2019 +0200

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 <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
(cherry picked from commit 8137df3a46abc6aa6ad0c7179d042e76ca2b2299)
[Juan A. Suarez: fix the structure usage]
Signed-off-by: Juan A. Suarez Romero <jasuarez at igalia.com>

---

 src/amd/vulkan/radv_nir_to_llvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index c7c837d16f0..3860a8c715b 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -754,7 +754,7 @@ static void allocate_user_sgprs(struct radv_shader_context *ctx,
 	if (ctx->shader_info->info.loads_push_constants)
 		user_sgpr_count++;
 
-	if (ctx->streamout_buffers)
+	if (ctx->shader_info->info.so.num_outputs)
 		user_sgpr_count++;
 
 	uint32_t available_sgprs = ctx->options->chip_class >= GFX9 && stage != MESA_SHADER_COMPUTE ? 32 : 16;




More information about the mesa-commit mailing list