aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/SwizzleAdd.glsl
blob: 057cb6cac978bd444e90186b1a5031fabe83b149 (plain) (blame)
1
2
3
4
5
6
7
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);
    int lutIdx = (mask >> (int($SUBGROUP_INVOCATION$ & 3u) * 2)) & 3;
    return x * xLut[lutIdx] + y * yLut[lutIdx];
}