From: Marek Olšák <marek.ol...@amd.com>

---
 src/gallium/drivers/radeonsi/si_shader.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
b/src/gallium/drivers/radeonsi/si_shader.c
index e8d08cd8e7f..0d24c3af10a 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3591,20 +3591,23 @@ static void si_llvm_emit_es_epilogue(struct 
ac_shader_abi *abi,
                int param;
 
                if (info->output_semantic_name[i] == 
TGSI_SEMANTIC_VIEWPORT_INDEX ||
                    info->output_semantic_name[i] == TGSI_SEMANTIC_LAYER)
                        continue;
 
                param = 
si_shader_io_get_unique_index(info->output_semantic_name[i],
                                                      
info->output_semantic_index[i]);
 
                for (chan = 0; chan < 4; chan++) {
+                       if (!(info->output_usagemask[i] & (1 << chan)))
+                               continue;
+
                        LLVMValueRef out_val = LLVMBuildLoad(ctx->ac.builder, 
addrs[4 * i + chan], "");
                        out_val = ac_to_integer(&ctx->ac, out_val);
 
                        /* GFX9 has the ESGS ring in LDS. */
                        if (ctx->screen->info.chip_class >= GFX9) {
                                lds_store(ctx, param * 4 + chan, lds_base, 
out_val);
                                continue;
                        }
 
                        ac_build_buffer_store_dword(&ctx->ac,
-- 
2.17.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to