nir/remove_dead_variables: fixup for new foreach_block()
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:

committed by
Jason Ekstrand

parent
b3aaae398e
commit
db35177772
@@ -65,11 +65,12 @@ add_var_use_tex(nir_tex_instr *instr, struct set *live)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static void
|
||||||
add_var_use_block(nir_block *block, void *state)
|
add_var_use_shader(nir_shader *shader, struct set *live)
|
||||||
{
|
{
|
||||||
struct set *live = state;
|
nir_foreach_function(shader, function) {
|
||||||
|
if (function->impl) {
|
||||||
|
nir_foreach_block(block, function->impl) {
|
||||||
nir_foreach_instr(block, instr) {
|
nir_foreach_instr(block, instr) {
|
||||||
switch(instr->type) {
|
switch(instr->type) {
|
||||||
case nir_instr_type_intrinsic:
|
case nir_instr_type_intrinsic:
|
||||||
@@ -88,16 +89,7 @@ add_var_use_block(nir_block *block, void *state)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
add_var_use_shader(nir_shader *shader, struct set *live)
|
|
||||||
{
|
|
||||||
nir_foreach_function(shader, function) {
|
|
||||||
if (function->impl) {
|
|
||||||
nir_foreach_block_call(function->impl, add_var_use_block, live);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user