mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
36 lines
948 B
C#
36 lines
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}\".")
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
}
|