radv: make use of the output usage mask in GS copy shader
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 13 Sep 2018 13:57:58 +0000 (15:57 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 14 Sep 2018 08:59:52 +0000 (10:59 +0200)
This is just for consistency because LLVM can detect and
remove unused loads.

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 e9842af10d21fe07263fa0b4c5b998ce12cd0ced..a96cc34fefc555d07728d9f1985aa12bc2d2bb01 100644 (file)
@@ -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);