Mesa (master): gallium/radeon: avoid redundant work with overlapping in/ out arrays

Nicolai Hähnle nh at kemper.freedesktop.org
Mon Oct 10 08:39:56 UTC 2016


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

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Fri Oct  7 12:54:34 2016 +0200

gallium/radeon: avoid redundant work with overlapping in/out arrays

Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak at 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
@@ -680,7 +680,8 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base,
 	{
 		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)
@@ -706,6 +707,8 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base,
 		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,




More information about the mesa-commit mailing list