nir/lower_blend: return progress

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26976>
This commit is contained in:
Alyssa Rosenzweig 2024-01-09 15:56:56 -04:00 committed by Marge Bot
parent 29bd0a8ffa
commit caffc3abca
2 changed files with 11 additions and 10 deletions

View file

@ -635,19 +635,20 @@ consume_dual_stores(nir_builder *b, nir_intrinsic_instr *store, void *data)
* This pass requires that shader I/O is lowered to explicit load/store
* instructions using nir_lower_io.
*/
void
bool
nir_lower_blend(nir_shader *shader, const nir_lower_blend_options *options)
{
assert(shader->info.stage == MESA_SHADER_FRAGMENT);
struct ctx ctx = { .options = options };
nir_shader_intrinsics_pass(shader, consume_dual_stores,
nir_metadata_block_index |
nir_metadata_dominance,
ctx.src1);
bool progress = nir_shader_intrinsics_pass(shader, consume_dual_stores,
nir_metadata_block_index |
nir_metadata_dominance,
ctx.src1);
nir_shader_intrinsics_pass(shader, nir_lower_blend_instr,
nir_metadata_block_index |
nir_metadata_dominance,
&ctx);
progress |= nir_shader_intrinsics_pass(shader, nir_lower_blend_instr,
nir_metadata_block_index |
nir_metadata_dominance,
&ctx);
return progress;
}

View file

@ -59,7 +59,7 @@ typedef struct {
bool scalar_blend_const;
} nir_lower_blend_options;
void nir_lower_blend(nir_shader *shader,
bool nir_lower_blend(nir_shader *shader,
const nir_lower_blend_options *options);
#endif