diff options
author | Rob Clark <[email protected]> | 2016-09-08 14:05:39 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-09-14 13:45:32 -0400 |
commit | 2c3f9662762f6e45b47ea5d3047f5596b555f29c (patch) | |
tree | 49e4af2ba04ed6afb6d4abc32ab94974654ae770 /src/compiler/nir/nir_lower_tex.c | |
parent | 7206b3a5565c0835589f85388ae9c121dfd5b5a5 (diff) |
nir/lower_tex: remove tex_instr_find_src()
Turns out it already exists.. so don't duplicate it.
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_lower_tex.c')
-rw-r--r-- | src/compiler/nir/nir_lower_tex.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index 93637a33844..b5705985f82 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -38,17 +38,6 @@ #include "nir.h" #include "nir_builder.h" -static int -tex_instr_find_src(nir_tex_instr *tex, nir_tex_src_type src_type) -{ - for (unsigned i = 0; i < tex->num_srcs; i++) { - if (tex->src[i].src_type == src_type) - return i; - } - - return -1; -} - static void tex_instr_remove_src(nir_tex_instr *tex, unsigned src_idx) { @@ -69,7 +58,7 @@ static void project_src(nir_builder *b, nir_tex_instr *tex) { /* Find the projector in the srcs list, if present. */ - int proj_index = tex_instr_find_src(tex, nir_tex_src_projector); + int proj_index = nir_tex_instr_src_index(tex, nir_tex_src_projector); if (proj_index < 0) return; @@ -131,11 +120,11 @@ project_src(nir_builder *b, nir_tex_instr *tex) static bool lower_offset(nir_builder *b, nir_tex_instr *tex) { - int offset_index = tex_instr_find_src(tex, nir_tex_src_offset); + int offset_index = nir_tex_instr_src_index(tex, nir_tex_src_offset); if (offset_index < 0) return false; - int coord_index = tex_instr_find_src(tex, nir_tex_src_coord); + int coord_index = nir_tex_instr_src_index(tex, nir_tex_src_coord); assert(coord_index >= 0); assert(tex->src[offset_index].src.is_ssa); |