From: Nicolai Hähnle <nicolai.haeh...@amd.com>

---
 src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c 
b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index 8e364c9..da4a030 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -673,21 +673,22 @@ static void emit_declaration(struct lp_build_tgsi_context 
*bld_base,
                                }
                                ctx->temps[first * TGSI_NUM_CHANNELS + i] = ptr;
                        }
                }
                break;
        }
        case TGSI_FILE_INPUT:
        {
                unsigned idx;
                for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) {
-                       if (ctx->load_input) {
+                       if (ctx->load_input &&
+                           ctx->input_decls[idx].Declaration.File != 
TGSI_FILE_INPUT) {
                                ctx->input_decls[idx] = *decl;
 
                                if (bld_base->info->processor != 
PIPE_SHADER_FRAGMENT)
                                        ctx->load_input(ctx, idx, decl,
                                                        &ctx->inputs[idx * 4]);
                        }
                }
        }
        break;
 
@@ -699,20 +700,22 @@ static void emit_declaration(struct lp_build_tgsi_context 
*bld_base,
                }
        }
        break;
 
        case TGSI_FILE_OUTPUT:
        {
                unsigned idx;
                for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) {
                        unsigned chan;
                        assert(idx < RADEON_LLVM_MAX_OUTPUTS);
+                       if (ctx->soa.outputs[idx][0])
+                               continue;
                        for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
                                ctx->soa.outputs[idx][chan] = 
lp_build_alloca_undef(
                                        &ctx->gallivm,
                                        ctx->soa.bld_base.base.elem_type, "");
                        }
                }
                break;
        }
 
        case TGSI_FILE_MEMORY:
-- 
2.7.4

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

Reply via email to