The code considers that projector lowering was done even if it's not
really the case. Change the project_src() prototype to return a bool
encoding whether projector lowering happened or not and update the
progress var accordingly in nir_lower_tex_block().
---
Changes in v2:
* Add Jason R-b
* Drop the part suggesting that nir_lower_rect() could be called in
a do-while(progress) loop.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
#include "nir_builder.h"
#include "nir_format_convert.h"
-static void
+static bool
project_src(nir_builder *b, nir_tex_instr *tex)
{
/* Find the projector in the srcs list, if present. */
int proj_index = nir_tex_instr_src_index(tex, nir_tex_src_projector);
if (proj_index < 0)
- return;
+ return false;
b->cursor = nir_before_instr(&tex->instr);
}
nir_tex_instr_remove_src(tex, proj_index);
+ return true;
}
static nir_ssa_def *
* as clamping happens *after* projection:
*/
if (lower_txp || sat_mask) {
- project_src(b, tex);
- progress = true;
+ progress |= project_src(b, tex);
}
if ((tex->op == nir_texop_txf && options->lower_txf_offset) ||