diff options
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/nir.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 13489f0d38e..4a88cd1837c 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -717,9 +717,16 @@ nir_instr_insert(nir_cursor cursor, nir_instr *instr) } static bool +src_is_valid(const nir_src *src) +{ + return src->is_ssa ? (src->ssa != NULL) : (src->reg.reg != NULL); +} + +static bool remove_use_cb(nir_src *src, void *state) { - list_del(&src->use_link); + if (src_is_valid(src)) + list_del(&src->use_link); return true; } @@ -1102,12 +1109,6 @@ nir_srcs_equal(nir_src src1, nir_src src2) } } -static bool -src_is_valid(const nir_src *src) -{ - return src->is_ssa ? (src->ssa != NULL) : (src->reg.reg != NULL); -} - static void src_remove_all_uses(nir_src *src) { |