From fbc064a5b45d424612df3d92d465a956460af44e Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 13 Sep 2018 15:57:58 +0200 Subject: [PATCH] radv: make use of the output usage mask in GS copy shader This is just for consistency because LLVM can detect and remove unused loads. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_nir_to_llvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c index e9842af10d2..a96cc34fefc 100644 --- a/src/amd/vulkan/radv_nir_to_llvm.c +++ b/src/amd/vulkan/radv_nir_to_llvm.c @@ -3609,6 +3609,9 @@ ac_gs_copy_shader_emit(struct radv_shader_context *ctx) for (unsigned j = 0; j < length; j++) { LLVMValueRef value, soffset; + if (!(output_usage_mask & (1 << j))) + continue; + soffset = LLVMConstInt(ctx->ac.i32, (slot * 4 + j) * ctx->gs_max_out_vertices * 16 * 4, false); -- 2.30.2