2019-10-31 03:29:22 +00:00
|
|
|
float Helper_SwizzleAdd(float x, float y, int mask)
|
|
|
|
{
|
|
|
|
vec4 xLut = vec4(1.0, -1.0, 1.0, 0.0);
|
|
|
|
vec4 yLut = vec4(1.0, 1.0, -1.0, 1.0);
|
2022-12-08 17:08:07 +00:00
|
|
|
int lutIdx = (mask >> (int($SUBGROUP_INVOCATION$ & 3u) * 2)) & 3;
|
2019-10-31 03:29:22 +00:00
|
|
|
return x * xLut[lutIdx] + y * yLut[lutIdx];
|
|
|
|
}
|