0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-12-25 01:25:46 +00:00
ryujinx-fork/Ryujinx.Graphics.OpenGL/Converters/TargetConverter.cs

34 lines
1.4 KiB
C#
Raw Normal View History

2019-10-13 06:02:07 +00:00
using OpenTK.Graphics.OpenGL;
using Ryujinx.Graphics.GAL.Texture;
using System;
namespace Ryujinx.Graphics.OpenGL
{
static class TargetConverter
{
public static ImageTarget ConvertToImageTarget(this Target target)
{
return (ImageTarget)target.Convert();
}
public static TextureTarget Convert(this Target target)
{
switch (target)
{
case Target.Texture1D: return TextureTarget.Texture1D;
case Target.Texture2D: return TextureTarget.Texture2D;
case Target.Texture3D: return TextureTarget.Texture3D;
case Target.Texture1DArray: return TextureTarget.Texture1DArray;
case Target.Texture2DArray: return TextureTarget.Texture2DArray;
case Target.Texture2DMultisample: return TextureTarget.Texture2DMultisample;
case Target.Rectangle: return TextureTarget.TextureRectangle;
case Target.Cubemap: return TextureTarget.TextureCubeMap;
case Target.CubemapArray: return TextureTarget.TextureCubeMapArray;
case Target.TextureBuffer: return TextureTarget.TextureBuffer;
}
throw new ArgumentException($"Invalid target \"{target}\".");
}
}
}