Depth Sampler Fixes

This commit is contained in:
Isaac Marovitz
2024-05-22 15:44:00 -04:00
committed by Evan Husted
parent 486fd78eba
commit b76f9105c8
3 changed files with 41 additions and 17 deletions

View File

@@ -158,16 +158,29 @@ namespace Ryujinx.Graphics.Shader
public static string ToMslTextureType(this SamplerType type)
{
string typeName = (type & SamplerType.Mask) switch
string typeName;
if ((type & SamplerType.Shadow) != 0)
{
SamplerType.None => "texture",
SamplerType.Texture1D => "texture1d",
SamplerType.TextureBuffer => "texturebuffer",
SamplerType.Texture2D => "texture2d",
SamplerType.Texture3D => "texture3d",
SamplerType.TextureCube => "texturecube",
_ => throw new ArgumentException($"Invalid sampler type \"{type}\"."),
};
typeName = (type & SamplerType.Mask) switch
{
SamplerType.Texture2D => "depth2d",
SamplerType.TextureCube => "depthcube",
_ => throw new ArgumentException($"Invalid shadow texture type \"{type}\"."),
};
}
else
{
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)
{