Add partial support for array of samplers, and add pass to identify them from bindless texture accesses

This commit is contained in:
gdk 2019-11-02 23:07:21 -03:00 committed by Thog
parent 63345a3098
commit 3ab5c23f49
10 changed files with 210 additions and 39 deletions

View file

@ -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;
}