nir/search: support swizzles on expressions in replacement patterns

Before this wasn't a compile time error, but it also didn't do anything.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36117>
This commit is contained in:
Georg Lehmann
2025-07-14 17:10:07 +02:00
committed by Marge Bot
parent 4be68b119e
commit 92cf02ee23
+4 -1
View File
@@ -500,7 +500,10 @@ construct_value(nir_builder *build,
nir_alu_src val;
val.src = nir_src_for_ssa(&alu->def);
memcpy(val.swizzle, identity_swizzle, sizeof val.swizzle);
if (expr->swizzle < 0)
memcpy(val.swizzle, identity_swizzle, sizeof(val.swizzle));
else
memset(val.swizzle, expr->swizzle, sizeof(val.swizzle));
return val;
}