[Mesa-dev] [PATCH 2/3] radeonsi: set si_shader_context::input_decls for ranged decls correctly

Marek Olšák maraeo at gmail.com
Tue Jan 3 19:17:03 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

This has no effect because no code uses those members with ranged decls.
---
 src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
index 2f38949..996a458 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
@@ -870,23 +870,26 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base,
 		}
 		break;
 	}
 	case TGSI_FILE_INPUT:
 	{
 		unsigned idx;
 		for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) {
 			if (ctx->load_input &&
 			    ctx->input_decls[idx].Declaration.File != TGSI_FILE_INPUT) {
 				ctx->input_decls[idx] = *decl;
+				ctx->input_decls[idx].Range.First = idx;
+				ctx->input_decls[idx].Range.Last = idx;
+				ctx->input_decls[idx].Semantic.Index += idx - decl->Range.First;
 
 				if (bld_base->info->processor != PIPE_SHADER_FRAGMENT)
-					ctx->load_input(ctx, idx, decl,
+					ctx->load_input(ctx, idx, &ctx->input_decls[idx],
 							&ctx->inputs[idx * 4]);
 			}
 		}
 	}
 	break;
 
 	case TGSI_FILE_SYSTEM_VALUE:
 	{
 		unsigned idx;
 		for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) {
-- 
2.7.4



More information about the mesa-dev mailing list