summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_search.c
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-06-20 21:23:53 -0400
committerJonathan Marek <[email protected]>2019-07-24 17:36:21 -0400
commit5a4e71c082886810504ecfa329fb57050acc623f (patch)
tree68628812a2966bc2fab49067b5e3db9144536278 /src/compiler/nir/nir_search.c
parentb4f476867238a5ce288b9295e9ec38250493f2c1 (diff)
nir/algebraic: allow swizzle in nir_algebraic replace expression
This is to allow optimizations in nir_opt_algebraic not otherwise possible Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_search.c')
-rw-r--r--src/compiler/nir/nir_search.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index 8e3c3529a74..c62de4ad7fe 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -506,6 +506,9 @@ construct_value(nir_builder *build,
(void *)build->shader);
assert(!var->is_constant);
+ for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++)
+ val.swizzle[i] = state->variables[var->variable].swizzle[var->swizzle[i]];
+
return val;
}