etnaviv: nir: Return progress for etna_lower_io(..)

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33621>
This commit is contained in:
Christian Gmeiner
2025-02-19 11:42:06 +01:00
committed by Marge Bot
parent 0c30468c78
commit 131e30d8b9
2 changed files with 18 additions and 2 deletions
+17 -1
View File
@@ -41,11 +41,14 @@ color_index_for_location(unsigned location)
/* io related lowering
* run after lower_int_to_float because it adds i2f/f2i ops
*/
void
bool
etna_lower_io(nir_shader *shader, struct etna_shader_variant *v)
{
bool progress = false;
nir_foreach_function_impl(impl, shader) {
nir_builder b = nir_builder_create(impl);
bool func_progress = false;
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
@@ -68,6 +71,8 @@ etna_lower_io(nir_shader *shader, struct etna_shader_variant *v)
nir_def_rewrite_uses_after(&intr->def,
ssa,
ssa->parent_instr);
func_progress = true;
} break;
case nir_intrinsic_store_deref: {
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
@@ -90,6 +95,8 @@ etna_lower_io(nir_shader *shader, struct etna_shader_variant *v)
alu->src[0].swizzle[0] = 2;
alu->src[0].swizzle[2] = 0;
nir_src_rewrite(&intr->src[1], ssa);
func_progress = true;
} break;
case nir_intrinsic_load_vertex_id:
case nir_intrinsic_load_instance_id:
@@ -154,9 +161,18 @@ etna_lower_io(nir_shader *shader, struct etna_shader_variant *v)
tex->coord_components = 4;
nir_instr_insert_before(&tex->instr, &vec->instr);
func_progress = true;
}
}
if (func_progress)
nir_metadata_preserve(impl, nir_metadata_none);
progress |= func_progress;
}
return progress;
}
static bool
+1 -1
View File
@@ -28,7 +28,7 @@
#include "compiler/nir/nir_builder.h"
#include "etnaviv_compiler.h"
void
bool
etna_lower_io(nir_shader *shader, struct etna_shader_variant *v);
bool