2021-08-12 06:09:56 +00:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Shader
|
|
|
|
{
|
2022-04-10 20:28:44 +00:00
|
|
|
public enum AttributeType : byte
|
2021-08-12 06:09:56 +00:00
|
|
|
{
|
|
|
|
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}\".")
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|