From: Samuel Pitoiset Date: Thu, 13 Sep 2018 13:57:58 +0000 (+0200) Subject: radv: make use of the output usage mask in GS copy shader X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbc064a5b45d424612df3d92d465a956460af44e;p=mesa.git 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 --- 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);