2019-10-30 23:29:22 -04: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);
|
2021-09-19 08:38:39 -04:00
|
|
|
int lutIdx = mask >> int($SUBGROUP_INVOCATION$ & 3u) * 2;
|
2019-10-30 23:29:22 -04:00
|
|
|
return x * xLut[lutIdx] + y * yLut[lutIdx];
|
|
|
|
}
|