mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 12:50:46 -07:00
Simplify logic for bindless texture handling (#1667)
* Simplify logic for bindless texture handling * Nits
This commit is contained in:
@ -241,22 +241,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
||||
|
||||
public static string GetSamplerName(ShaderStage stage, AstTextureOperation texOp, string indexExpr)
|
||||
{
|
||||
string suffix;
|
||||
string suffix = texOp.CbufSlot < 0 ? $"_tcb_{texOp.Handle:X}" : $"_cb{texOp.CbufSlot}_{texOp.Handle:X}";
|
||||
|
||||
if ((texOp.Flags & TextureFlags.Bindless) != 0)
|
||||
if ((texOp.Type & SamplerType.Indexed) != 0)
|
||||
{
|
||||
AstOperand operand = texOp.GetSource(0) as AstOperand;
|
||||
|
||||
suffix = $"_{texOp.Type.ToGlslSamplerType()}_cb{operand.CbufSlot}_{operand.CbufOffset}";
|
||||
}
|
||||
else
|
||||
{
|
||||
suffix = texOp.Handle.ToString("X");
|
||||
|
||||
if ((texOp.Type & SamplerType.Indexed) != 0)
|
||||
{
|
||||
suffix += $"a[{indexExpr}]";
|
||||
}
|
||||
suffix += $"a[{indexExpr}]";
|
||||
}
|
||||
|
||||
return GetShaderStagePrefix(stage) + "_" + DefaultNames.SamplerNamePrefix + suffix;
|
||||
@ -264,7 +253,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
|
||||
|
||||
public static string GetImageName(ShaderStage stage, AstTextureOperation texOp, string indexExpr)
|
||||
{
|
||||
string suffix = texOp.Handle.ToString("X") + "_" + texOp.Format.ToGlslFormat();
|
||||
string suffix = texOp.CbufSlot < 0 ? $"_tcb_{texOp.Handle:X}_{texOp.Format.ToGlslFormat()}" : $"_cb{texOp.CbufSlot}_{texOp.Handle:X}_{texOp.Format.ToGlslFormat()}";
|
||||
|
||||
if ((texOp.Type & SamplerType.Indexed) != 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user