aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-06-17 11:23:33 +0200
committerAlyssa Rosenzweig <[email protected]>2019-06-18 06:36:07 -0700
commit352b1d9c311b1468857cce30191994586520ef46 (patch)
treea1e962c357b8a87e75db6eabcdd22becd8b41ceb /src/compiler
parent6f60fec48fe70c7e8cfe5f8c9752c057794e8a34 (diff)
nir/lower_tex: Actually report when projector lowering happened
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 <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_tex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 53719017a87..04ca8f88c25 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -39,13 +39,13 @@
#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);
@@ -100,6 +100,7 @@ project_src(nir_builder *b, nir_tex_instr *tex)
}
nir_tex_instr_remove_src(tex, proj_index);
+ return true;
}
static nir_ssa_def *
@@ -1005,8 +1006,7 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
* 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) ||