nir: Return progress from nir_lower_64bit_pack().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
@@ -2568,7 +2568,7 @@ typedef enum {
|
|||||||
} nir_lower_doubles_options;
|
} nir_lower_doubles_options;
|
||||||
|
|
||||||
bool nir_lower_doubles(nir_shader *shader, nir_lower_doubles_options options);
|
bool nir_lower_doubles(nir_shader *shader, nir_lower_doubles_options options);
|
||||||
void nir_lower_64bit_pack(nir_shader *shader);
|
bool nir_lower_64bit_pack(nir_shader *shader);
|
||||||
|
|
||||||
bool nir_normalize_cubemap_coords(nir_shader *shader);
|
bool nir_normalize_cubemap_coords(nir_shader *shader);
|
||||||
|
|
||||||
|
@@ -48,11 +48,12 @@ lower_unpack_64(nir_builder *b, nir_ssa_def *src)
|
|||||||
nir_unpack_64_2x32_split_y(b, src));
|
nir_unpack_64_2x32_split_y(b, src));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static bool
|
||||||
lower_64bit_pack_impl(nir_function_impl *impl)
|
lower_64bit_pack_impl(nir_function_impl *impl)
|
||||||
{
|
{
|
||||||
nir_builder b;
|
nir_builder b;
|
||||||
nir_builder_init(&b, impl);
|
nir_builder_init(&b, impl);
|
||||||
|
bool progress = false;
|
||||||
|
|
||||||
nir_foreach_block(block, impl) {
|
nir_foreach_block(block, impl) {
|
||||||
nir_foreach_instr_safe(instr, block) {
|
nir_foreach_instr_safe(instr, block) {
|
||||||
@@ -83,15 +84,24 @@ lower_64bit_pack_impl(nir_function_impl *impl)
|
|||||||
|
|
||||||
nir_ssa_def_rewrite_uses(&alu_instr->dest.dest.ssa, nir_src_for_ssa(dest));
|
nir_ssa_def_rewrite_uses(&alu_instr->dest.dest.ssa, nir_src_for_ssa(dest));
|
||||||
nir_instr_remove(&alu_instr->instr);
|
nir_instr_remove(&alu_instr->instr);
|
||||||
}
|
nir_metadata_preserve(impl, nir_metadata_block_index |
|
||||||
|
nir_metadata_dominance);
|
||||||
|
progress = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
return progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
nir_lower_64bit_pack(nir_shader *shader)
|
nir_lower_64bit_pack(nir_shader *shader)
|
||||||
{
|
{
|
||||||
|
bool progress = false;
|
||||||
|
|
||||||
nir_foreach_function(function, shader) {
|
nir_foreach_function(function, shader) {
|
||||||
if (function->impl)
|
if (function->impl)
|
||||||
lower_64bit_pack_impl(function->impl);
|
progress |= lower_64bit_pack_impl(function->impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user