From f7db71949e5a72ad44d3219b46efabb144914506 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Tue, 22 Jul 2025 13:35:16 -0700 Subject: [PATCH] gallium/aux: nir_lower_pstipple_fs progress and metadata Acked-by: Alyssa Rosenzweig Part-of: --- src/gallium/auxiliary/nir/nir_draw_helpers.c | 11 ++++++++--- src/gallium/auxiliary/nir/nir_draw_helpers.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/nir/nir_draw_helpers.c b/src/gallium/auxiliary/nir/nir_draw_helpers.c index 3e93011ef33..272102c4645 100644 --- a/src/gallium/auxiliary/nir/nir_draw_helpers.c +++ b/src/gallium/auxiliary/nir/nir_draw_helpers.c @@ -111,7 +111,7 @@ nir_lower_pstipple_impl(nir_function_impl *impl, nir_lower_pstipple_block(start, state); } -void +bool nir_lower_pstipple_fs(struct nir_shader *shader, unsigned *samplerUnitOut, unsigned fixedUnit, @@ -127,8 +127,10 @@ nir_lower_pstipple_fs(struct nir_shader *shader, assert(bool_type == nir_type_bool1 || bool_type == nir_type_bool32); - if (shader->info.stage != MESA_SHADER_FRAGMENT) - return; + if (shader->info.stage != MESA_SHADER_FRAGMENT) { + nir_shader_preserve_all_metadata(shader); + return false; + } int binding = 0; nir_foreach_uniform_variable(var, shader) { @@ -149,10 +151,13 @@ nir_lower_pstipple_fs(struct nir_shader *shader, BITSET_SET(shader->info.samplers_used, binding); state.stip_tex = tex_var; + bool progress = false; nir_foreach_function_impl(impl, shader) { nir_lower_pstipple_impl(impl, &state); + progress |= nir_progress(true, impl, nir_metadata_none); } *samplerUnitOut = binding; + return progress; } typedef struct { diff --git a/src/gallium/auxiliary/nir/nir_draw_helpers.h b/src/gallium/auxiliary/nir/nir_draw_helpers.h index 966789c8803..b21cf023d33 100644 --- a/src/gallium/auxiliary/nir/nir_draw_helpers.h +++ b/src/gallium/auxiliary/nir/nir_draw_helpers.h @@ -31,7 +31,7 @@ extern "C" { #endif struct nir_shader; -void +bool nir_lower_pstipple_fs(struct nir_shader *shader, unsigned *samplerUnitOut, unsigned fixedUnit,