aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenPacking.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenPacking.cs')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenPacking.cs16
1 files changed, 3 insertions, 13 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenPacking.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenPacking.cs
index 4a40032c..e5167f93 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenPacking.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenPacking.cs
@@ -24,22 +24,12 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
string srcExpr = GetSoureExpr(context, src, GetSrcVarType(operation.Inst, 0));
- return $"unpackHalf2x16({srcExpr}){GetMask(operation.ComponentMask)}";
+ return $"unpackHalf2x16({srcExpr}){GetMask(operation.Index)}";
}
- private static string GetMask(int compMask)
+ private static string GetMask(int index)
{
- string mask = ".";
-
- for (int index = 0; index < 2; index++)
- {
- if ((compMask & (1 << index)) != 0)
- {
- mask += "xy".Substring(index, 1);
- }
- }
-
- return mask;
+ return '.' + "xy".Substring(index, 1);
}
}
} \ No newline at end of file