From 1a8424cebaeaf46a01000624a46764f3e84dad85 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 8 Sep 2016 14:07:06 -0400 Subject: nir: move tex_instr_remove_src I want to re-use this in a different pass, so move to nir.h Signed-off-by: Rob Clark Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir_lower_tex.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src/compiler/nir/nir_lower_tex.c') diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index b5705985f82..a40575806cb 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -38,22 +38,6 @@ #include "nir.h" #include "nir_builder.h" -static void -tex_instr_remove_src(nir_tex_instr *tex, unsigned src_idx) -{ - assert(src_idx < tex->num_srcs); - - /* First rewrite the source to NIR_SRC_INIT */ - nir_instr_rewrite_src(&tex->instr, &tex->src[src_idx].src, NIR_SRC_INIT); - - /* Now, move all of the other sources down */ - for (unsigned i = src_idx + 1; i < tex->num_srcs; i++) { - tex->src[i-1].src_type = tex->src[i].src_type; - nir_instr_move_src(&tex->instr, &tex->src[i-1].src, &tex->src[i].src); - } - tex->num_srcs--; -} - static void project_src(nir_builder *b, nir_tex_instr *tex) { @@ -114,7 +98,7 @@ project_src(nir_builder *b, nir_tex_instr *tex) nir_src_for_ssa(projected)); } - tex_instr_remove_src(tex, proj_index); + nir_tex_instr_remove_src(tex, proj_index); } static bool @@ -159,7 +143,7 @@ lower_offset(nir_builder *b, nir_tex_instr *tex) nir_instr_rewrite_src(&tex->instr, &tex->src[coord_index].src, nir_src_for_ssa(offset_coord)); - tex_instr_remove_src(tex, offset_index); + nir_tex_instr_remove_src(tex, offset_index); return true; } -- cgit v1.2.3