mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-05 14:56:26 +02:00
Merge Latest Ryujinx (Unstable)
This commit is contained in:
parent
aaefc0a9e5
commit
12ab8bc3e2
1237 changed files with 48656 additions and 21399 deletions
|
@ -16,9 +16,8 @@ namespace Ryujinx.Graphics.Shader
|
|||
Mask = 0xff,
|
||||
|
||||
Array = 1 << 8,
|
||||
Indexed = 1 << 9,
|
||||
Multisample = 1 << 10,
|
||||
Shadow = 1 << 11,
|
||||
Multisample = 1 << 9,
|
||||
Shadow = 1 << 10,
|
||||
}
|
||||
|
||||
static class SamplerTypeExtensions
|
||||
|
@ -36,10 +35,41 @@ namespace Ryujinx.Graphics.Shader
|
|||
};
|
||||
}
|
||||
|
||||
public static string ToShortSamplerType(this SamplerType type)
|
||||
{
|
||||
string typeName = (type & SamplerType.Mask) switch
|
||||
{
|
||||
SamplerType.Texture1D => "1d",
|
||||
SamplerType.TextureBuffer => "b",
|
||||
SamplerType.Texture2D => "2d",
|
||||
SamplerType.Texture3D => "3d",
|
||||
SamplerType.TextureCube => "cube",
|
||||
_ => throw new ArgumentException($"Invalid sampler type \"{type}\"."),
|
||||
};
|
||||
|
||||
if ((type & SamplerType.Multisample) != 0)
|
||||
{
|
||||
typeName += "ms";
|
||||
}
|
||||
|
||||
if ((type & SamplerType.Array) != 0)
|
||||
{
|
||||
typeName += "a";
|
||||
}
|
||||
|
||||
if ((type & SamplerType.Shadow) != 0)
|
||||
{
|
||||
typeName += "s";
|
||||
}
|
||||
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public static string ToGlslSamplerType(this SamplerType type)
|
||||
{
|
||||
string typeName = (type & SamplerType.Mask) switch
|
||||
{
|
||||
SamplerType.None => "sampler",
|
||||
SamplerType.Texture1D => "sampler1D",
|
||||
SamplerType.TextureBuffer => "samplerBuffer",
|
||||
SamplerType.Texture2D => "sampler2D",
|
||||
|
@ -66,6 +96,31 @@ namespace Ryujinx.Graphics.Shader
|
|||
return typeName;
|
||||
}
|
||||
|
||||
public static string ToGlslTextureType(this SamplerType type)
|
||||
{
|
||||
string typeName = (type & SamplerType.Mask) switch
|
||||
{
|
||||
SamplerType.Texture1D => "texture1D",
|
||||
SamplerType.TextureBuffer => "textureBuffer",
|
||||
SamplerType.Texture2D => "texture2D",
|
||||
SamplerType.Texture3D => "texture3D",
|
||||
SamplerType.TextureCube => "textureCube",
|
||||
_ => throw new ArgumentException($"Invalid texture type \"{type}\"."),
|
||||
};
|
||||
|
||||
if ((type & SamplerType.Multisample) != 0)
|
||||
{
|
||||
typeName += "MS";
|
||||
}
|
||||
|
||||
if ((type & SamplerType.Array) != 0)
|
||||
{
|
||||
typeName += "Array";
|
||||
}
|
||||
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public static string ToGlslImageType(this SamplerType type, AggregateType componentType)
|
||||
{
|
||||
string typeName = (type & SamplerType.Mask) switch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue