mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace Ryujinx.Graphics.Shader
|
|
{
|
|
[Flags]
|
|
enum InterpolationQualifier
|
|
{
|
|
None = 0,
|
|
|
|
Flat = 1,
|
|
NoPerspective = 2,
|
|
Smooth = 3,
|
|
|
|
Centroid = 1 << 16,
|
|
Sample = 1 << 17,
|
|
|
|
FlagsMask = Centroid | Sample
|
|
}
|
|
|
|
static class InterpolationQualifierExtensions
|
|
{
|
|
public static string ToGlslQualifier(this InterpolationQualifier iq)
|
|
{
|
|
string output = (iq & ~InterpolationQualifier.FlagsMask) switch
|
|
{
|
|
InterpolationQualifier.Flat => "flat",
|
|
InterpolationQualifier.NoPerspective => "noperspective",
|
|
InterpolationQualifier.Smooth => "smooth",
|
|
_ => string.Empty
|
|
};
|
|
|
|
if ((iq & InterpolationQualifier.Centroid) != 0)
|
|
{
|
|
output = "centroid " + output;
|
|
}
|
|
else if ((iq & InterpolationQualifier.Sample) != 0)
|
|
{
|
|
output = "sample " + output;
|
|
}
|
|
|
|
return output;
|
|
}
|
|
}
|
|
} |