diff options
| author | gdk <gab.dark.100@gmail.com> | 2019-10-17 23:41:18 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | 1b7d95519569639135a68e7ebda5148f3263217c (patch) | |
| tree | 52a5e471418bf28ce970a268e1b86b64abc9048f /Ryujinx.Graphics.Shader/SamplerType.cs | |
| parent | 717ace6f6ed65118148dc78976c6e818a095fa4d (diff) | |
Initial support for image stores, support texture sample on compute
Diffstat (limited to 'Ryujinx.Graphics.Shader/SamplerType.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/SamplerType.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/SamplerType.cs b/Ryujinx.Graphics.Shader/SamplerType.cs new file mode 100644 index 00000000..42854c97 --- /dev/null +++ b/Ryujinx.Graphics.Shader/SamplerType.cs @@ -0,0 +1,37 @@ +using System; + +namespace Ryujinx.Graphics.Shader +{ + [Flags] + public enum SamplerType + { + Texture1D, + TextureBuffer, + Texture2D, + Texture3D, + TextureCube, + + Mask = 0xff, + + Array = 1 << 8, + Multisample = 1 << 9, + Shadow = 1 << 10 + } + + static class SamplerTypeExtensions + { + public static int GetDimensions(this SamplerType type) + { + switch (type & SamplerType.Mask) + { + case SamplerType.Texture1D: return 1; + case SamplerType.TextureBuffer: return 1; + case SamplerType.Texture2D: return 2; + case SamplerType.Texture3D: return 3; + case SamplerType.TextureCube: return 3; + } + + throw new ArgumentException($"Invalid texture type \"{type}\"."); + } + } +}
\ No newline at end of file |
