aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs16
1 files changed, 13 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
index fe307396..36f76ec5 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
@@ -223,7 +223,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
return ubName + "_" + DefaultNames.UniformNameSuffix;
}
- public static string GetSamplerName(ShaderStage stage, AstTextureOperation texOp)
+ public static string GetSamplerName(ShaderStage stage, AstTextureOperation texOp, string indexExpr)
{
string suffix;
@@ -235,16 +235,26 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
}
else
{
- suffix = (texOp.Handle - 8).ToString();
+ suffix = texOp.Handle.ToString();
+
+ if ((texOp.Type & SamplerType.Indexed) != 0)
+ {
+ suffix += $"a[{indexExpr}]";
+ }
}
return GetShaderStagePrefix(stage) + "_" + DefaultNames.SamplerNamePrefix + suffix;
}
- public static string GetImageName(ShaderStage stage, AstTextureOperation texOp)
+ public static string GetImageName(ShaderStage stage, AstTextureOperation texOp, string indexExpr)
{
string suffix = texOp.Handle.ToString();
+ if ((texOp.Type & SamplerType.Indexed) != 0)
+ {
+ suffix += $"a[{indexExpr}]";
+ }
+
return GetShaderStagePrefix(stage) + "_" + DefaultNames.ImageNamePrefix + suffix;
}