Mesa (master): radeonsi: remove si_shader_output_values::index

Marek Olšák mareko at kemper.freedesktop.org
Sun Oct 12 21:54:29 UTC 2014


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Oct  4 22:37:23 2014 +0200

radeonsi: remove si_shader_output_values::index

It's redundant now.

It led to a simplification in si_llvm_emit_streamout, because outidx == reg.

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/gallium/drivers/radeonsi/si_shader.c |   23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 2a12179..c1a1e7b 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -49,7 +49,6 @@ struct si_shader_output_values
 {
 	LLVMValueRef values[4];
 	unsigned name;
-	unsigned index;
 	unsigned sid;
 };
 
@@ -1031,24 +1030,16 @@ static void si_llvm_emit_streamout(struct si_shader_context *shader,
 			if (!num_comps || num_comps > 4)
 				continue;
 
+			if (reg >= noutput)
+				continue;
+
 			/* Load the output as int. */
 			for (j = 0; j < num_comps; j++) {
-				unsigned outidx = 0;
-
-				while (outidx < noutput && outputs[outidx].index != reg)
-					outidx++;
-
-				if (outidx < noutput)
-					out[j] = LLVMBuildBitCast(builder,
-								  outputs[outidx].values[start+j],
-								  i32, "");
-				else
-					out[j] = NULL;
+				out[j] = LLVMBuildBitCast(builder,
+							  outputs[reg].values[start+j],
+						i32, "");
 			}
 
-			if (!out[0])
-				continue;
-
 			/* Pack the output. */
 			LLVMValueRef vdata = NULL;
 
@@ -1317,7 +1308,6 @@ static void si_llvm_emit_vs_epilogue(struct lp_build_tgsi_context * bld_base)
 	for (i = 0; i < info->num_outputs; i++) {
 		outputs[i].name = info->output_semantic_name[i];
 		outputs[i].sid = info->output_semantic_index[i];
-		outputs[i].index = i;
 
 		for (j = 0; j < 4; j++)
 			outputs[i].values[j] =
@@ -2656,7 +2646,6 @@ static int si_generate_gs_copy_shader(struct si_screen *sscreen,
 		unsigned chan;
 
 		outputs[i].name = gsinfo->output_semantic_name[i];
-		outputs[i].index = i;
 		outputs[i].sid = gsinfo->output_semantic_index[i];
 
 		for (chan = 0; chan < 4; chan++) {




More information about the mesa-commit mailing list