Module: Mesa
Branch: master
Commit: fbc064a5b45d424612df3d92d465a956460af44e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fbc064a5b45d424612df3d92d465a956460af44e

Author: Samuel Pitoiset <[email protected]>
Date:   Thu Sep 13 15:57:58 2018 +0200

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 <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>

---

 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 e9842af10d..a96cc34fef 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);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to