Add partial support for array of samplers, and add pass to identify them from bindless texture accesses
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user