mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-21 00:23:36 +00:00
36 lines
No EOL
948 B
C#
36 lines
No EOL
948 B
C#
using System;
|
|
|
|
namespace Ryujinx.Graphics.Shader
|
|
{
|
|
public enum AttributeType : byte
|
|
{
|
|
Float,
|
|
Sint,
|
|
Uint
|
|
}
|
|
|
|
static class AttributeTypeExtensions
|
|
{
|
|
public static string GetScalarType(this AttributeType type)
|
|
{
|
|
return type switch
|
|
{
|
|
AttributeType.Float => "float",
|
|
AttributeType.Sint => "int",
|
|
AttributeType.Uint => "uint",
|
|
_ => throw new ArgumentException($"Invalid attribute type \"{type}\".")
|
|
};
|
|
}
|
|
|
|
public static string GetVec4Type(this AttributeType type)
|
|
{
|
|
return type switch
|
|
{
|
|
AttributeType.Float => "vec4",
|
|
AttributeType.Sint => "ivec4",
|
|
AttributeType.Uint => "uvec4",
|
|
_ => throw new ArgumentException($"Invalid attribute type \"{type}\".")
|
|
};
|
|
}
|
|
}
|
|
} |