aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/SamplerType.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Graphics.Shader/SamplerType.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Graphics.Shader/SamplerType.cs')
-rw-r--r--Ryujinx.Graphics.Shader/SamplerType.cs100
1 files changed, 0 insertions, 100 deletions
diff --git a/Ryujinx.Graphics.Shader/SamplerType.cs b/Ryujinx.Graphics.Shader/SamplerType.cs
deleted file mode 100644
index 620f4ccf..00000000
--- a/Ryujinx.Graphics.Shader/SamplerType.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using Ryujinx.Graphics.Shader.Translation;
-using System;
-
-namespace Ryujinx.Graphics.Shader
-{
- [Flags]
- public enum SamplerType
- {
- None = 0,
- Texture1D,
- TextureBuffer,
- Texture2D,
- Texture3D,
- TextureCube,
-
- Mask = 0xff,
-
- Array = 1 << 8,
- Indexed = 1 << 9,
- Multisample = 1 << 10,
- Shadow = 1 << 11
- }
-
- static class SamplerTypeExtensions
- {
- public static int GetDimensions(this SamplerType type)
- {
- return (type & SamplerType.Mask) switch
- {
- SamplerType.Texture1D => 1,
- SamplerType.TextureBuffer => 1,
- SamplerType.Texture2D => 2,
- SamplerType.Texture3D => 3,
- SamplerType.TextureCube => 3,
- _ => throw new ArgumentException($"Invalid sampler type \"{type}\".")
- };
- }
-
- public static string ToGlslSamplerType(this SamplerType type)
- {
- string typeName = (type & SamplerType.Mask) switch
- {
- SamplerType.Texture1D => "sampler1D",
- SamplerType.TextureBuffer => "samplerBuffer",
- SamplerType.Texture2D => "sampler2D",
- SamplerType.Texture3D => "sampler3D",
- SamplerType.TextureCube => "samplerCube",
- _ => throw new ArgumentException($"Invalid sampler type \"{type}\".")
- };
-
- if ((type & SamplerType.Multisample) != 0)
- {
- typeName += "MS";
- }
-
- if ((type & SamplerType.Array) != 0)
- {
- typeName += "Array";
- }
-
- if ((type & SamplerType.Shadow) != 0)
- {
- typeName += "Shadow";
- }
-
- return typeName;
- }
-
- public static string ToGlslImageType(this SamplerType type, AggregateType componentType)
- {
- string typeName = (type & SamplerType.Mask) switch
- {
- SamplerType.Texture1D => "image1D",
- SamplerType.TextureBuffer => "imageBuffer",
- SamplerType.Texture2D => "image2D",
- SamplerType.Texture3D => "image3D",
- SamplerType.TextureCube => "imageCube",
- _ => throw new ArgumentException($"Invalid sampler type \"{type}\".")
- };
-
- if ((type & SamplerType.Multisample) != 0)
- {
- typeName += "MS";
- }
-
- if ((type & SamplerType.Array) != 0)
- {
- typeName += "Array";
- }
-
- switch (componentType)
- {
- case AggregateType.U32: typeName = 'u' + typeName; break;
- case AggregateType.S32: typeName = 'i' + typeName; break;
- }
-
- return typeName;
- }
- }
-} \ No newline at end of file