mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-24 12:34:15 +00:00
parent
25ec4eddfa
commit
7cd52fecb5
1 changed files with 12 additions and 4 deletions
|
@ -116,12 +116,20 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
|||
|
||||
private static string GetVec4Indexed(string vectorName, string indexExpr)
|
||||
{
|
||||
string result = $"{vectorName}.x";
|
||||
for (int i = 1; i < 4; i++)
|
||||
bool canIndexVec4 = false;
|
||||
if (canIndexVec4)
|
||||
{
|
||||
result = $"(({indexExpr}) == {i}) ? ({vectorName}.{GetSwizzleMask(i)}) : ({result})";
|
||||
return $"{vectorName}[{indexExpr}]";
|
||||
}
|
||||
else
|
||||
{
|
||||
string result = $"{vectorName}.x";
|
||||
for (int i = 1; i < 4; i++)
|
||||
{
|
||||
result = $"(({indexExpr}) == {i}) ? ({vectorName}.{GetSwizzleMask(i)}) : ({result})";
|
||||
}
|
||||
return $"({result})";
|
||||
}
|
||||
return $"({result})";
|
||||
}
|
||||
|
||||
public static string GetConstantBufferName(IAstNode slot, string offsetExpr, ShaderStage stage)
|
||||
|
|
Loading…
Reference in a new issue