diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2023-08-16 08:30:33 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-16 08:30:33 -0300 |
| commit | effd546331371928bc38bc8a48b0c26c7c59f3e9 (patch) | |
| tree | ec760ee09a3751abd3b5a261ad5be599942a3a35 /src/Ryujinx.Graphics.Shader/AttributeType.cs | |
| parent | 492a0463358e7706e0fb34537d55810d833ae695 (diff) | |
Implement scaled vertex format emulation (#5564)
* Implement scaled vertex format emulation
* Auto-format (whitespace)
* Delete ToVec4Type
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/AttributeType.cs')
| -rw-r--r-- | src/Ryujinx.Graphics.Shader/AttributeType.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Shader/AttributeType.cs b/src/Ryujinx.Graphics.Shader/AttributeType.cs index e6adb4b8..1d950773 100644 --- a/src/Ryujinx.Graphics.Shader/AttributeType.cs +++ b/src/Ryujinx.Graphics.Shader/AttributeType.cs @@ -9,6 +9,8 @@ namespace Ryujinx.Graphics.Shader Float, Sint, Uint, + Sscaled, + Uscaled, } static class AttributeTypeExtensions @@ -23,5 +25,18 @@ namespace Ryujinx.Graphics.Shader _ => throw new ArgumentException($"Invalid attribute type \"{type}\"."), }; } + + public static AggregateType ToAggregateType(this AttributeType type, bool supportsScaledFormats) + { + return type switch + { + AttributeType.Float => AggregateType.FP32, + AttributeType.Sint => AggregateType.S32, + AttributeType.Uint => AggregateType.U32, + AttributeType.Sscaled => supportsScaledFormats ? AggregateType.FP32 : AggregateType.S32, + AttributeType.Uscaled => supportsScaledFormats ? AggregateType.FP32 : AggregateType.U32, + _ => throw new ArgumentException($"Invalid attribute type \"{type}\"."), + }; + } } } |
