From af8498d6790ba83f1cf87eccf5f272f2ccbeb169 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 28 Dec 2019 20:45:33 -0300 Subject: Add basic error logging to the GPU --- .../Converters/AddressModeConverter.cs | 26 -- .../Converters/BlendFactorConverter.cs | 73 ---- .../Converters/BlendOpConverter.cs | 35 -- .../Converters/CompareModeConverter.cs | 20 - .../Converters/CompareOpConverter.cs | 41 -- .../Converters/DepthModeConverter.cs | 20 - .../Converters/DepthStencilModeConverter.cs | 20 - .../Converters/FaceConverter.cs | 23 -- .../Converters/FrontFaceConverter.cs | 22 -- .../Converters/IndexTypeConverter.cs | 21 - .../Converters/MagFilterConverter.cs | 20 - .../Converters/MinFilterConverter.cs | 24 -- .../Converters/PrimitiveTopologyConverter.cs | 33 -- .../Converters/StencilOpConverter.cs | 27 -- .../Converters/SwizzleComponentConverter.cs | 24 -- .../Converters/TargetConverter.cs | 33 -- Ryujinx.Graphics.OpenGL/Debugger.cs | 25 +- Ryujinx.Graphics.OpenGL/EnumConversion.cs | 423 +++++++++++++++++++++ Ryujinx.Graphics.OpenGL/FormatInfo.cs | 45 +++ Ryujinx.Graphics.OpenGL/FormatTable.cs | 183 +++++++++ Ryujinx.Graphics.OpenGL/Formats/FormatInfo.cs | 45 --- Ryujinx.Graphics.OpenGL/Formats/FormatTable.cs | 183 --------- Ryujinx.Graphics.OpenGL/Pipeline.cs | 22 +- Ryujinx.Graphics.OpenGL/Program.cs | 9 +- .../Ryujinx.Graphics.OpenGL.csproj | 1 + Ryujinx.Graphics.OpenGL/TextureStorage.cs | 10 +- Ryujinx.Graphics.OpenGL/TextureView.cs | 3 +- Ryujinx.Graphics.OpenGL/VertexArray.cs | 1 - 28 files changed, 695 insertions(+), 717 deletions(-) delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/AddressModeConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/BlendFactorConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/BlendOpConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/CompareModeConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/CompareOpConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/DepthModeConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/DepthStencilModeConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/FaceConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/FrontFaceConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/IndexTypeConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/MagFilterConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/MinFilterConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/PrimitiveTopologyConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/StencilOpConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/SwizzleComponentConverter.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Converters/TargetConverter.cs create mode 100644 Ryujinx.Graphics.OpenGL/EnumConversion.cs create mode 100644 Ryujinx.Graphics.OpenGL/FormatInfo.cs create mode 100644 Ryujinx.Graphics.OpenGL/FormatTable.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Formats/FormatInfo.cs delete mode 100644 Ryujinx.Graphics.OpenGL/Formats/FormatTable.cs (limited to 'Ryujinx.Graphics.OpenGL') diff --git a/Ryujinx.Graphics.OpenGL/Converters/AddressModeConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/AddressModeConverter.cs deleted file mode 100644 index 8f9b5074..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/AddressModeConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Sampler; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class AddressModeConverter - { - public static TextureWrapMode Convert(this AddressMode mode) - { - switch (mode) - { - case AddressMode.Clamp : return TextureWrapMode.Clamp; - case AddressMode.Repeat : return TextureWrapMode.Repeat; - case AddressMode.MirrorClamp : return (TextureWrapMode)ExtTextureMirrorClamp.MirrorClampExt; - case AddressMode.MirrorClampToEdge : return (TextureWrapMode)ExtTextureMirrorClamp.MirrorClampToEdgeExt; - case AddressMode.MirrorClampToBorder : return (TextureWrapMode)ExtTextureMirrorClamp.MirrorClampToBorderExt; - case AddressMode.ClampToBorder : return TextureWrapMode.ClampToBorder; - case AddressMode.MirroredRepeat : return TextureWrapMode.MirroredRepeat; - case AddressMode.ClampToEdge : return TextureWrapMode.ClampToEdge; - } - - throw new ArgumentException($"Invalid address mode \"{mode}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/BlendFactorConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/BlendFactorConverter.cs deleted file mode 100644 index db5099a7..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/BlendFactorConverter.cs +++ /dev/null @@ -1,73 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Blend; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class BlendFactorConverter - { - public static All Convert(this BlendFactor factor) - { - switch (factor) - { - case BlendFactor.Zero: - case BlendFactor.ZeroGl: - return All.Zero; - case BlendFactor.One: - case BlendFactor.OneGl: - return All.One; - case BlendFactor.SrcColor: - case BlendFactor.SrcColorGl: - return All.SrcColor; - case BlendFactor.OneMinusSrcColor: - case BlendFactor.OneMinusSrcColorGl: - return All.OneMinusSrcColor; - case BlendFactor.SrcAlpha: - case BlendFactor.SrcAlphaGl: - return All.SrcAlpha; - case BlendFactor.OneMinusSrcAlpha: - case BlendFactor.OneMinusSrcAlphaGl: - return All.OneMinusSrcAlpha; - case BlendFactor.DstAlpha: - case BlendFactor.DstAlphaGl: - return All.DstAlpha; - case BlendFactor.OneMinusDstAlpha: - case BlendFactor.OneMinusDstAlphaGl: - return All.OneMinusDstAlpha; - case BlendFactor.DstColor: - case BlendFactor.DstColorGl: - return All.DstColor; - case BlendFactor.OneMinusDstColor: - case BlendFactor.OneMinusDstColorGl: - return All.OneMinusDstColor; - case BlendFactor.SrcAlphaSaturate: - case BlendFactor.SrcAlphaSaturateGl: - return All.SrcAlphaSaturate; - case BlendFactor.Src1Color: - case BlendFactor.Src1ColorGl: - return All.Src1Color; - case BlendFactor.OneMinusSrc1Color: - case BlendFactor.OneMinusSrc1ColorGl: - return All.OneMinusSrc1Color; - case BlendFactor.Src1Alpha: - case BlendFactor.Src1AlphaGl: - return All.Src1Alpha; - case BlendFactor.OneMinusSrc1Alpha: - case BlendFactor.OneMinusSrc1AlphaGl: - return All.OneMinusSrc1Alpha; - case BlendFactor.ConstantColor: - return All.ConstantColor; - case BlendFactor.OneMinusConstantColor: - return All.OneMinusConstantColor; - case BlendFactor.ConstantAlpha: - return All.ConstantAlpha; - case BlendFactor.OneMinusConstantAlpha: - return All.OneMinusConstantAlpha; - } - - return All.Zero; - - throw new ArgumentException($"Invalid blend factor \"{factor}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/BlendOpConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/BlendOpConverter.cs deleted file mode 100644 index 66d6a145..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/BlendOpConverter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Blend; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class BlendOpConverter - { - public static BlendEquationMode Convert(this BlendOp op) - { - switch (op) - { - case BlendOp.Add: - case BlendOp.AddGl: - return BlendEquationMode.FuncAdd; - case BlendOp.Subtract: - case BlendOp.SubtractGl: - return BlendEquationMode.FuncSubtract; - case BlendOp.ReverseSubtract: - case BlendOp.ReverseSubtractGl: - return BlendEquationMode.FuncReverseSubtract; - case BlendOp.Minimum: - case BlendOp.MinimumGl: - return BlendEquationMode.Min; - case BlendOp.Maximum: - case BlendOp.MaximumGl: - return BlendEquationMode.Max; - } - - return BlendEquationMode.FuncAdd; - - throw new ArgumentException($"Invalid blend operation \"{op}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/CompareModeConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/CompareModeConverter.cs deleted file mode 100644 index c0287d8a..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/CompareModeConverter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Sampler; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class CompareModeConverter - { - public static TextureCompareMode Convert(this CompareMode mode) - { - switch (mode) - { - case CompareMode.None: return TextureCompareMode.None; - case CompareMode.CompareRToTexture: return TextureCompareMode.CompareRToTexture; - } - - throw new ArgumentException($"Invalid compare mode \"{mode}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/CompareOpConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/CompareOpConverter.cs deleted file mode 100644 index a30ca02e..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/CompareOpConverter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL; - -namespace Ryujinx.Graphics.OpenGL -{ - static class CompareOpConverter - { - public static All Convert(this CompareOp op) - { - switch (op) - { - case CompareOp.Never: - case CompareOp.NeverGl: - return All.Never; - case CompareOp.Less: - case CompareOp.LessGl: - return All.Less; - case CompareOp.Equal: - case CompareOp.EqualGl: - return All.Equal; - case CompareOp.LessOrEqual: - case CompareOp.LessOrEqualGl: - return All.Lequal; - case CompareOp.Greater: - case CompareOp.GreaterGl: - return All.Greater; - case CompareOp.NotEqual: - case CompareOp.NotEqualGl: - return All.Notequal; - case CompareOp.GreaterOrEqual: - case CompareOp.GreaterOrEqualGl: - return All.Gequal; - case CompareOp.Always: - case CompareOp.AlwaysGl: - return All.Always; - } - - return All.Never; - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/DepthModeConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/DepthModeConverter.cs deleted file mode 100644 index a02f69d2..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/DepthModeConverter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class DepthModeConverter - { - public static ClipDepthMode Convert(this DepthMode mode) - { - switch (mode) - { - case DepthMode.MinusOneToOne: return ClipDepthMode.NegativeOneToOne; - case DepthMode.ZeroToOne: return ClipDepthMode.ZeroToOne; - } - - throw new ArgumentException($"Invalid depth mode \"{mode}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/DepthStencilModeConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/DepthStencilModeConverter.cs deleted file mode 100644 index 4d14bdea..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/DepthStencilModeConverter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Texture; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class DepthStencilModeConverter - { - public static All Convert(this DepthStencilMode mode) - { - switch (mode) - { - case DepthStencilMode.Depth: return All.Depth; - case DepthStencilMode.Stencil: return All.Stencil; - } - - throw new ArgumentException($"Invalid depth stencil mode \"{mode}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/FaceConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/FaceConverter.cs deleted file mode 100644 index 5c23b68a..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/FaceConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class FaceConverter - { - public static CullFaceMode Convert(this Face face) - { - switch (face) - { - case Face.Back: return CullFaceMode.Back; - case Face.Front: return CullFaceMode.Front; - case Face.FrontAndBack: return CullFaceMode.FrontAndBack; - } - - return CullFaceMode.FrontAndBack; - - throw new ArgumentException($"Invalid face \"{face}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/FrontFaceConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/FrontFaceConverter.cs deleted file mode 100644 index 1cae36cd..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/FrontFaceConverter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class FrontFaceConverter - { - public static FrontFaceDirection Convert(this FrontFace frontFace) - { - switch (frontFace) - { - case FrontFace.Clockwise: return FrontFaceDirection.Cw; - case FrontFace.CounterClockwise: return FrontFaceDirection.Ccw; - } - - return FrontFaceDirection.Cw; - - throw new ArgumentException($"Invalid front face \"{frontFace}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/IndexTypeConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/IndexTypeConverter.cs deleted file mode 100644 index d3100b98..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/IndexTypeConverter.cs +++ /dev/null @@ -1,21 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class IndexTypeConverter - { - public static DrawElementsType Convert(this IndexType type) - { - switch (type) - { - case IndexType.UByte: return DrawElementsType.UnsignedByte; - case IndexType.UShort: return DrawElementsType.UnsignedShort; - case IndexType.UInt: return DrawElementsType.UnsignedInt; - } - - throw new ArgumentException($"Invalid index type \"{type}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/MagFilterConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/MagFilterConverter.cs deleted file mode 100644 index cb75ee89..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/MagFilterConverter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Sampler; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class MagFilterConverter - { - public static TextureMagFilter Convert(this MagFilter filter) - { - switch (filter) - { - case MagFilter.Nearest: return TextureMagFilter.Nearest; - case MagFilter.Linear: return TextureMagFilter.Linear; - } - - return TextureMagFilter.Nearest; - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/MinFilterConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/MinFilterConverter.cs deleted file mode 100644 index 01436299..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/MinFilterConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Sampler; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class MinFilterConverter - { - public static TextureMinFilter Convert(this MinFilter filter) - { - switch (filter) - { - case MinFilter.Nearest: return TextureMinFilter.Nearest; - case MinFilter.Linear: return TextureMinFilter.Linear; - case MinFilter.NearestMipmapNearest: return TextureMinFilter.NearestMipmapNearest; - case MinFilter.LinearMipmapNearest: return TextureMinFilter.LinearMipmapNearest; - case MinFilter.NearestMipmapLinear: return TextureMinFilter.NearestMipmapLinear; - case MinFilter.LinearMipmapLinear: return TextureMinFilter.LinearMipmapLinear; - } - - return TextureMinFilter.Nearest; - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/PrimitiveTopologyConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/PrimitiveTopologyConverter.cs deleted file mode 100644 index fe1dfe39..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/PrimitiveTopologyConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class PrimitiveTopologyConverter - { - public static PrimitiveType Convert(this PrimitiveTopology topology) - { - switch (topology) - { - case PrimitiveTopology.Points: return PrimitiveType.Points; - case PrimitiveTopology.Lines: return PrimitiveType.Lines; - case PrimitiveTopology.LineLoop: return PrimitiveType.LineLoop; - case PrimitiveTopology.LineStrip: return PrimitiveType.LineStrip; - case PrimitiveTopology.Triangles: return PrimitiveType.Triangles; - case PrimitiveTopology.TriangleStrip: return PrimitiveType.TriangleStrip; - case PrimitiveTopology.TriangleFan: return PrimitiveType.TriangleFan; - case PrimitiveTopology.Quads: return PrimitiveType.Quads; - case PrimitiveTopology.QuadStrip: return PrimitiveType.QuadStrip; - case PrimitiveTopology.Polygon: return PrimitiveType.Polygon; - case PrimitiveTopology.LinesAdjacency: return PrimitiveType.LinesAdjacency; - case PrimitiveTopology.LineStripAdjacency: return PrimitiveType.LineStripAdjacency; - case PrimitiveTopology.TrianglesAdjacency: return PrimitiveType.TrianglesAdjacency; - case PrimitiveTopology.TriangleStripAdjacency: return PrimitiveType.TriangleStripAdjacency; - case PrimitiveTopology.Patches: return PrimitiveType.Patches; - } - - throw new ArgumentException($"Invalid primitive topology \"{topology}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/StencilOpConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/StencilOpConverter.cs deleted file mode 100644 index 44fbe0a5..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/StencilOpConverter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class StencilOpConverter - { - public static StencilOp Convert(this GAL.DepthStencil.StencilOp op) - { - switch (op) - { - case GAL.DepthStencil.StencilOp.Keep: return StencilOp.Keep; - case GAL.DepthStencil.StencilOp.Zero: return StencilOp.Zero; - case GAL.DepthStencil.StencilOp.Replace: return StencilOp.Replace; - case GAL.DepthStencil.StencilOp.IncrementAndClamp: return StencilOp.Incr; - case GAL.DepthStencil.StencilOp.DecrementAndClamp: return StencilOp.Decr; - case GAL.DepthStencil.StencilOp.Invert: return StencilOp.Invert; - case GAL.DepthStencil.StencilOp.IncrementAndWrap: return StencilOp.IncrWrap; - case GAL.DepthStencil.StencilOp.DecrementAndWrap: return StencilOp.DecrWrap; - } - - return StencilOp.Keep; - - throw new ArgumentException($"Invalid stencil operation \"{op}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/SwizzleComponentConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/SwizzleComponentConverter.cs deleted file mode 100644 index d9ce650f..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/SwizzleComponentConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL.Texture; -using System; - -namespace Ryujinx.Graphics.OpenGL -{ - static class SwizzleComponentConverter - { - public static All Convert(this SwizzleComponent swizzleComponent) - { - switch (swizzleComponent) - { - case SwizzleComponent.Zero: return All.Zero; - case SwizzleComponent.One: return All.One; - case SwizzleComponent.Red: return All.Red; - case SwizzleComponent.Green: return All.Green; - case SwizzleComponent.Blue: return All.Blue; - case SwizzleComponent.Alpha: return All.Alpha; - } - - throw new ArgumentException($"Invalid swizzle component \"{swizzleComponent}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Converters/TargetConverter.cs b/Ryujinx.Graphics.OpenGL/Converters/TargetConverter.cs deleted file mode 100644 index 6b524980..00000000 --- a/Ryujinx.Graphics.OpenGL/Converters/TargetConverter.cs +++ /dev/null @@ -1,33 +0,0 @@ -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}\"."); - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Debugger.cs b/Ryujinx.Graphics.OpenGL/Debugger.cs index 9da98ae1..ff9fcd85 100644 --- a/Ryujinx.Graphics.OpenGL/Debugger.cs +++ b/Ryujinx.Graphics.OpenGL/Debugger.cs @@ -1,4 +1,5 @@ using OpenTK.Graphics.OpenGL; +using Ryujinx.Common.Logging; using System; using System.Runtime.InteropServices; @@ -12,16 +13,14 @@ namespace Ryujinx.Graphics.OpenGL { GL.Enable(EnableCap.DebugOutputSynchronous); - int[] array = null; + GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DontCare, DebugSeverityControl.DontCare, 0, (int[])null, true); - GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DontCare, DebugSeverityControl.DontCare, 0, array, true); - - _debugCallback = PrintDbg; + _debugCallback = GLDebugHandler; GL.DebugMessageCallback(_debugCallback, IntPtr.Zero); } - private static void PrintDbg( + private static void GLDebugHandler( DebugSource source, DebugType type, int id, @@ -30,14 +29,20 @@ namespace Ryujinx.Graphics.OpenGL IntPtr message, IntPtr userParam) { - string msg = Marshal.PtrToStringAnsi(message); + string fullMessage = $"{type} {severity} {source} {Marshal.PtrToStringAnsi(message)}"; - if (type == DebugType.DebugTypeError && !msg.Contains("link")) + switch (type) { - throw new Exception(msg); + case DebugType.DebugTypeError: + Logger.PrintError(LogClass.Gpu, fullMessage); + break; + case DebugType.DebugTypePerformance: + Logger.PrintWarning(LogClass.Gpu, fullMessage); + break; + default: + Logger.PrintDebug(LogClass.Gpu, fullMessage); + break; } - - System.Console.WriteLine("GL message: " + source + " " + type + " " + severity + " " + msg); } } } diff --git a/Ryujinx.Graphics.OpenGL/EnumConversion.cs b/Ryujinx.Graphics.OpenGL/EnumConversion.cs new file mode 100644 index 00000000..99ed0404 --- /dev/null +++ b/Ryujinx.Graphics.OpenGL/EnumConversion.cs @@ -0,0 +1,423 @@ +using OpenTK.Graphics.OpenGL; +using Ryujinx.Common.Logging; +using Ryujinx.Graphics.GAL; +using Ryujinx.Graphics.GAL.Blend; +using Ryujinx.Graphics.GAL.Sampler; +using Ryujinx.Graphics.GAL.Texture; + +namespace Ryujinx.Graphics.OpenGL +{ + static class EnumConversion + { + public static TextureWrapMode Convert(this AddressMode mode) + { + switch (mode) + { + case AddressMode.Clamp: + return TextureWrapMode.Clamp; + case AddressMode.Repeat: + return TextureWrapMode.Repeat; + case AddressMode.MirrorClamp: + return (TextureWrapMode)ExtTextureMirrorClamp.MirrorClampExt; + case AddressMode.MirrorClampToEdge: + return (TextureWrapMode)ExtTextureMirrorClamp.MirrorClampToEdgeExt; + case AddressMode.MirrorClampToBorder: + return (TextureWrapMode)ExtTextureMirrorClamp.MirrorClampToBorderExt; + case AddressMode.ClampToBorder: + return TextureWrapMode.ClampToBorder; + case AddressMode.MirroredRepeat: + return TextureWrapMode.MirroredRepeat; + case AddressMode.ClampToEdge: + return TextureWrapMode.ClampToEdge; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(AddressMode)} enum value: {mode}."); + + return TextureWrapMode.Clamp; + } + + public static All Convert(this BlendFactor factor) + { + switch (factor) + { + case BlendFactor.Zero: + case BlendFactor.ZeroGl: + return All.Zero; + case BlendFactor.One: + case BlendFactor.OneGl: + return All.One; + case BlendFactor.SrcColor: + case BlendFactor.SrcColorGl: + return All.SrcColor; + case BlendFactor.OneMinusSrcColor: + case BlendFactor.OneMinusSrcColorGl: + return All.OneMinusSrcColor; + case BlendFactor.SrcAlpha: + case BlendFactor.SrcAlphaGl: + return All.SrcAlpha; + case BlendFactor.OneMinusSrcAlpha: + case BlendFactor.OneMinusSrcAlphaGl: + return All.OneMinusSrcAlpha; + case BlendFactor.DstAlpha: + case BlendFactor.DstAlphaGl: + return All.DstAlpha; + case BlendFactor.OneMinusDstAlpha: + case BlendFactor.OneMinusDstAlphaGl: + return All.OneMinusDstAlpha; + case BlendFactor.DstColor: + case BlendFactor.DstColorGl: + return All.DstColor; + case BlendFactor.OneMinusDstColor: + case BlendFactor.OneMinusDstColorGl: + return All.OneMinusDstColor; + case BlendFactor.SrcAlphaSaturate: + case BlendFactor.SrcAlphaSaturateGl: + return All.SrcAlphaSaturate; + case BlendFactor.Src1Color: + case BlendFactor.Src1ColorGl: + return All.Src1Color; + case BlendFactor.OneMinusSrc1Color: + case BlendFactor.OneMinusSrc1ColorGl: + return All.OneMinusSrc1Color; + case BlendFactor.Src1Alpha: + case BlendFactor.Src1AlphaGl: + return All.Src1Alpha; + case BlendFactor.OneMinusSrc1Alpha: + case BlendFactor.OneMinusSrc1AlphaGl: + return All.OneMinusSrc1Alpha; + case BlendFactor.ConstantColor: + return All.ConstantColor; + case BlendFactor.OneMinusConstantColor: + return All.OneMinusConstantColor; + case BlendFactor.ConstantAlpha: + return All.ConstantAlpha; + case BlendFactor.OneMinusConstantAlpha: + return All.OneMinusConstantAlpha; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(BlendFactor)} enum value: {factor}."); + + return All.Zero; + } + + public static BlendEquationMode Convert(this BlendOp op) + { + switch (op) + { + case BlendOp.Add: + case BlendOp.AddGl: + return BlendEquationMode.FuncAdd; + case BlendOp.Subtract: + case BlendOp.SubtractGl: + return BlendEquationMode.FuncSubtract; + case BlendOp.ReverseSubtract: + case BlendOp.ReverseSubtractGl: + return BlendEquationMode.FuncReverseSubtract; + case BlendOp.Minimum: + case BlendOp.MinimumGl: + return BlendEquationMode.Min; + case BlendOp.Maximum: + case BlendOp.MaximumGl: + return BlendEquationMode.Max; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}."); + + return BlendEquationMode.FuncAdd; + } + + public static TextureCompareMode Convert(this CompareMode mode) + { + switch (mode) + { + case CompareMode.None: + return TextureCompareMode.None; + case CompareMode.CompareRToTexture: + return TextureCompareMode.CompareRToTexture; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}."); + + return TextureCompareMode.None; + } + + public static All Convert(this CompareOp op) + { + switch (op) + { + case CompareOp.Never: + case CompareOp.NeverGl: + return All.Never; + case CompareOp.Less: + case CompareOp.LessGl: + return All.Less; + case CompareOp.Equal: + case CompareOp.EqualGl: + return All.Equal; + case CompareOp.LessOrEqual: + case CompareOp.LessOrEqualGl: + return All.Lequal; + case CompareOp.Greater: + case CompareOp.GreaterGl: + return All.Greater; + case CompareOp.NotEqual: + case CompareOp.NotEqualGl: + return All.Notequal; + case CompareOp.GreaterOrEqual: + case CompareOp.GreaterOrEqualGl: + return All.Gequal; + case CompareOp.Always: + case CompareOp.AlwaysGl: + return All.Always; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(CompareOp)} enum value: {op}."); + + return All.Never; + } + + public static ClipDepthMode Convert(this DepthMode mode) + { + switch (mode) + { + case DepthMode.MinusOneToOne: + return ClipDepthMode.NegativeOneToOne; + case DepthMode.ZeroToOne: + return ClipDepthMode.ZeroToOne; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(DepthMode)} enum value: {mode}."); + + return ClipDepthMode.NegativeOneToOne; + } + + public static All Convert(this DepthStencilMode mode) + { + switch (mode) + { + case DepthStencilMode.Depth: + return All.Depth; + case DepthStencilMode.Stencil: + return All.Stencil; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}."); + + return All.Depth; + } + + public static CullFaceMode Convert(this Face face) + { + switch (face) + { + case Face.Back: + return CullFaceMode.Back; + case Face.Front: + return CullFaceMode.Front; + case Face.FrontAndBack: + return CullFaceMode.FrontAndBack; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}."); + + return CullFaceMode.Back; + } + + public static FrontFaceDirection Convert(this FrontFace frontFace) + { + switch (frontFace) + { + case FrontFace.Clockwise: + return FrontFaceDirection.Cw; + case FrontFace.CounterClockwise: + return FrontFaceDirection.Ccw; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}."); + + return FrontFaceDirection.Cw; + } + + public static DrawElementsType Convert(this IndexType type) + { + switch (type) + { + case IndexType.UByte: + return DrawElementsType.UnsignedByte; + case IndexType.UShort: + return DrawElementsType.UnsignedShort; + case IndexType.UInt: + return DrawElementsType.UnsignedInt; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(IndexType)} enum value: {type}."); + + return DrawElementsType.UnsignedByte; + } + + public static TextureMagFilter Convert(this MagFilter filter) + { + switch (filter) + { + case MagFilter.Nearest: + return TextureMagFilter.Nearest; + case MagFilter.Linear: + return TextureMagFilter.Linear; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(MagFilter)} enum value: {filter}."); + + return TextureMagFilter.Nearest; + } + + public static TextureMinFilter Convert(this MinFilter filter) + { + switch (filter) + { + case MinFilter.Nearest: + return TextureMinFilter.Nearest; + case MinFilter.Linear: + return TextureMinFilter.Linear; + case MinFilter.NearestMipmapNearest: + return TextureMinFilter.NearestMipmapNearest; + case MinFilter.LinearMipmapNearest: + return TextureMinFilter.LinearMipmapNearest; + case MinFilter.NearestMipmapLinear: + return TextureMinFilter.NearestMipmapLinear; + case MinFilter.LinearMipmapLinear: + return TextureMinFilter.LinearMipmapLinear; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(MinFilter)} enum value: {filter}."); + + return TextureMinFilter.Nearest; + } + + public static PrimitiveType Convert(this PrimitiveTopology topology) + { + switch (topology) + { + case PrimitiveTopology.Points: + return PrimitiveType.Points; + case PrimitiveTopology.Lines: + return PrimitiveType.Lines; + case PrimitiveTopology.LineLoop: + return PrimitiveType.LineLoop; + case PrimitiveTopology.LineStrip: + return PrimitiveType.LineStrip; + case PrimitiveTopology.Triangles: + return PrimitiveType.Triangles; + case PrimitiveTopology.TriangleStrip: + return PrimitiveType.TriangleStrip; + case PrimitiveTopology.TriangleFan: + return PrimitiveType.TriangleFan; + case PrimitiveTopology.Quads: + return PrimitiveType.Quads; + case PrimitiveTopology.QuadStrip: + return PrimitiveType.QuadStrip; + case PrimitiveTopology.Polygon: + return PrimitiveType.Polygon; + case PrimitiveTopology.LinesAdjacency: + return PrimitiveType.LinesAdjacency; + case PrimitiveTopology.LineStripAdjacency: + return PrimitiveType.LineStripAdjacency; + case PrimitiveTopology.TrianglesAdjacency: + return PrimitiveType.TrianglesAdjacency; + case PrimitiveTopology.TriangleStripAdjacency: + return PrimitiveType.TriangleStripAdjacency; + case PrimitiveTopology.Patches: + return PrimitiveType.Patches; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(PrimitiveTopology)} enum value: {topology}."); + + return PrimitiveType.Points; + } + + public static StencilOp Convert(this GAL.DepthStencil.StencilOp op) + { + switch (op) + { + case GAL.DepthStencil.StencilOp.Keep: + return StencilOp.Keep; + case GAL.DepthStencil.StencilOp.Zero: + return StencilOp.Zero; + case GAL.DepthStencil.StencilOp.Replace: + return StencilOp.Replace; + case GAL.DepthStencil.StencilOp.IncrementAndClamp: + return StencilOp.Incr; + case GAL.DepthStencil.StencilOp.DecrementAndClamp: + return StencilOp.Decr; + case GAL.DepthStencil.StencilOp.Invert: + return StencilOp.Invert; + case GAL.DepthStencil.StencilOp.IncrementAndWrap: + return StencilOp.IncrWrap; + case GAL.DepthStencil.StencilOp.DecrementAndWrap: + return StencilOp.DecrWrap; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(GAL.DepthStencil.StencilOp)} enum value: {op}."); + + return StencilOp.Keep; + } + + public static All Convert(this SwizzleComponent swizzleComponent) + { + switch (swizzleComponent) + { + case SwizzleComponent.Zero: + return All.Zero; + case SwizzleComponent.One: + return All.One; + case SwizzleComponent.Red: + return All.Red; + case SwizzleComponent.Green: + return All.Green; + case SwizzleComponent.Blue: + return All.Blue; + case SwizzleComponent.Alpha: + return All.Alpha; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(SwizzleComponent)} enum value: {swizzleComponent}."); + + return All.Zero; + } + + 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; + } + + Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(Target)} enum value: {target}."); + + return TextureTarget.Texture2D; + } + } +} diff --git a/Ryujinx.Graphics.OpenGL/FormatInfo.cs b/Ryujinx.Graphics.OpenGL/FormatInfo.cs new file mode 100644 index 00000000..6aa70691 --- /dev/null +++ b/Ryujinx.Graphics.OpenGL/FormatInfo.cs @@ -0,0 +1,45 @@ +using OpenTK.Graphics.OpenGL; + +namespace Ryujinx.Graphics.OpenGL +{ + struct FormatInfo + { + public int Components { get; } + public bool Normalized { get; } + public bool Scaled { get; } + + public PixelInternalFormat PixelInternalFormat { get; } + public PixelFormat PixelFormat { get; } + public PixelType PixelType { get; } + + public bool IsCompressed { get; } + + public FormatInfo( + int components, + bool normalized, + bool scaled, + All pixelInternalFormat, + PixelFormat pixelFormat, + PixelType pixelType) + { + Components = components; + Normalized = normalized; + Scaled = scaled; + PixelInternalFormat = (PixelInternalFormat)pixelInternalFormat; + PixelFormat = pixelFormat; + PixelType = pixelType; + IsCompressed = false; + } + + public FormatInfo(int components, bool normalized, bool scaled, All pixelFormat) + { + Components = components; + Normalized = normalized; + Scaled = scaled; + PixelInternalFormat = 0; + PixelFormat = (PixelFormat)pixelFormat; + PixelType = 0; + IsCompressed = true; + } + } +} diff --git a/Ryujinx.Graphics.OpenGL/FormatTable.cs b/Ryujinx.Graphics.OpenGL/FormatTable.cs new file mode 100644 index 00000000..38197a90 --- /dev/null +++ b/Ryujinx.Graphics.OpenGL/FormatTable.cs @@ -0,0 +1,183 @@ +using OpenTK.Graphics.OpenGL; +using Ryujinx.Graphics.GAL; +using System; + +namespace Ryujinx.Graphics.OpenGL +{ + struct FormatTable + { + private static FormatInfo[] _table; + + static FormatTable() + { + _table = new FormatInfo[Enum.GetNames(typeof(Format)).Length]; + + Add(Format.R8Unorm, new FormatInfo(1, true, false, All.R8, PixelFormat.Red, PixelType.UnsignedByte)); + Add(Format.R8Snorm, new FormatInfo(1, true, false, All.R8Snorm, PixelFormat.Red, PixelType.Byte)); + Add(Format.R8Uint, new FormatInfo(1, false, false, All.R8ui, PixelFormat.RedInteger, PixelType.UnsignedByte)); + Add(Format.R8Sint, new FormatInfo(1, false, false, All.R8i, PixelFormat.RedInteger, PixelType.Byte)); + Add(Format.R16Float, new FormatInfo(1, false, false, All.R16f, PixelFormat.Red, PixelType.HalfFloat)); + Add(Format.R16Unorm, new FormatInfo(1, true, false, All.R16, PixelFormat.Red, PixelType.UnsignedShort)); + Add(Format.R16Snorm, new FormatInfo(1, true, false, All.R16Snorm, PixelFormat.Red, PixelType.Short)); + Add(Format.R16Uint, new FormatInfo(1, false, false, All.R16ui, PixelFormat.RedInteger, PixelType.UnsignedShort)); + Add(Format.R16Sint, new FormatInfo(1, false, false, All.R16i, PixelFormat.RedInteger, PixelType.Short)); + Add(Format.R32Float, new FormatInfo(1, false, false, All.R32f, PixelFormat.Red, PixelType.Float)); + Add(Format.R32Uint, new FormatInfo(1, false, false, All.R32ui, PixelFormat.RedInteger, PixelType.UnsignedInt)); + Add(Format.R32Sint, new FormatInfo(1, false, false, All.R32i, PixelFormat.RedInteger, PixelType.Int)); + Add(Format.R8G8Unorm, new FormatInfo(2, true, false, All.Rg8, PixelFormat.Rg, PixelType.UnsignedByte)); + Add(Format.R8G8Snorm, new FormatInfo(2, true, false, All.Rg8Snorm, PixelFormat.Rg, PixelType.Byte)); + Add(Format.R8G8Uint, new FormatInfo(2, false, false, All.Rg8ui, PixelFormat.RgInteger, PixelType.UnsignedByte)); + Add(Format.R8G8Sint, new FormatInfo(2, false, false, All.Rg8i, PixelFormat.RgInteger, PixelType.Byte)); + Add(Format.R16G16Float, new FormatInfo(2, false, false, All.Rg16f, PixelFormat.Rg, PixelType.HalfFloat)); + Add(Format.R16G16Unorm, new FormatInfo(2, true, false, All.Rg16, PixelFormat.Rg, PixelType.UnsignedShort)); + Add(Format.R16G16Snorm, new FormatInfo(2, true, false, All.Rg16Snorm, PixelFormat.Rg, PixelType.Short)); + Add(Format.R16G16Uint, new FormatInfo(2, false, false, All.Rg16ui, PixelFormat.RgInteger, PixelType.UnsignedShort)); + Add(Format.R16G16Sint, new FormatInfo(2, false, false, All.Rg16i, PixelFormat.RgInteger, PixelType.Short)); + Add(Format.R32G32Float, new FormatInfo(2, false, false, All.Rg32f, PixelFormat.Rg, PixelType.Float)); + Add(Format.R32G32Uint, new FormatInfo(2, false, false, All.Rg32ui, PixelFormat.RgInteger, PixelType.UnsignedInt)); + Add(Format.R32G32Sint, new FormatInfo(2, false, false, All.Rg32i, PixelFormat.RgInteger, PixelType.Int)); + Add(Format.R8G8B8Unorm, new FormatInfo(3, true, false, All.Rgb8, PixelFormat.Rgb, PixelType.UnsignedByte)); + Add(Format.R8G8B8Snorm, new FormatInfo(3, true, false, All.Rgb8Snorm, PixelFormat.Rgb, PixelType.Byte)); + Add(Format.R8G8B8Uint, new FormatInfo(3, false, false, All.Rgb8ui, PixelFormat.RgbInteger, PixelType.UnsignedByte)); + Add(Format.R8G8B8Sint, new FormatInfo(3, false, false, All.Rgb8i, PixelFormat.RgbInteger, PixelType.Byte)); + Add(Format.R16G16B16Float, new FormatInfo(3, false, false, All.Rgb16f, PixelFormat.Rgb, PixelType.HalfFloat)); + Add(Format.R16G16B16Unorm, new FormatInfo(3, true, false, All.Rgb16, PixelFormat.Rgb, PixelType.UnsignedShort)); + Add(Format.R16G16B16Snorm, new FormatInfo(3, true, false, All.Rgb16Snorm, PixelFormat.Rgb, PixelType.Short)); + Add(Format.R16G16B16Uint, new FormatInfo(3, false, false, All.Rgb16ui, PixelFormat.RgbInteger, PixelType.UnsignedShort)); + Add(Format.R16G16B16Sint, new FormatInfo(3, false, false, All.Rgb16i, PixelFormat.RgbInteger, PixelType.Short)); + Add(Format.R32G32B32Float, new FormatInfo(3, false, false, All.Rgb32f, PixelFormat.Rgb, PixelType.Float)); + Add(Format.R32G32B32Uint, new FormatInfo(3, false, false, All.Rgb32ui, PixelFormat.RgbInteger, PixelType.UnsignedInt)); + Add(Format.R32G32B32Sint, new FormatInfo(3, false, false, All.Rgb32i, PixelFormat.RgbInteger, PixelType.Int)); + Add(Format.R8G8B8A8Unorm, new FormatInfo(4, true, false, All.Rgba8, PixelFormat.Rgba, PixelType.UnsignedByte)); + Add(Format.R8G8B8A8Snorm, new FormatInfo(4, true, false, All.Rgba8Snorm, PixelFormat.Rgba, PixelType.Byte)); + Add(Format.R8G8B8A8Uint, new FormatInfo(4, false, false, All.Rgba8ui, PixelFormat.RgbaInteger, PixelType.UnsignedByte)); + Add(Format.R8G8B8A8Sint, new FormatInfo(4, false, false, All.Rgba8i, PixelFormat.RgbaInteger, PixelType.Byte)); + Add(Format.R16G16B16A16Float, new FormatInfo(4, false, false, All.Rgba16f, PixelFormat.Rgba, PixelType.HalfFloat)); + Add(Format.R16G16B16A16Unorm, new FormatInfo(4, true, false, All.Rgba16, PixelFormat.Rgba, PixelType.UnsignedShort)); + Add(Format.R16G16B16A16Snorm, new FormatInfo(4, true, false, All.Rgba16Snorm, PixelFormat.Rgba, PixelType.Short)); + Add(Format.R16G16B16A16Uint, new FormatInfo(4, false, false, All.Rgba16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort)); + Add(Format.R16G16B16A16Sint, new FormatInfo(4, false, false, All.Rgba16i, PixelFormat.RgbaInteger, PixelType.Short)); + Add(Format.R32G32B32A32Float, new FormatInfo(4, false, false, All.Rgba32f, PixelFormat.Rgba, PixelType.Float)); + Add(Format.R32G32B32A32Uint, new FormatInfo(4, false, false, All.Rgba32ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt)); + Add(Format.R32G32B32A32Sint, new FormatInfo(4, false, false, All.Rgba32i, PixelFormat.RgbaInteger, PixelType.Int)); + Add(Format.S8Uint, new FormatInfo(1, false, false, All.StencilIndex8, PixelFormat.StencilIndex, PixelType.UnsignedByte)); + Add(Format.D16Unorm, new FormatInfo(1, false, false, All.DepthComponent16, PixelFormat.DepthComponent, PixelType.UnsignedShort)); + Add(Format.D24X8Unorm, new FormatInfo(1, false, false, All.DepthComponent24, PixelFormat.DepthComponent, PixelType.UnsignedInt)); + Add(Format.D32Float, new FormatInfo(1, false, false, All.DepthComponent32f, PixelFormat.DepthComponent, PixelType.Float)); + Add(Format.D24UnormS8Uint, new FormatInfo(1, false, false, All.Depth24Stencil8, PixelFormat.DepthStencil, PixelType.UnsignedInt248)); + Add(Format.D32FloatS8Uint, new FormatInfo(1, false, false, All.Depth32fStencil8, PixelFormat.DepthStencil, PixelType.Float32UnsignedInt248Rev)); + Add(Format.R8G8B8X8Srgb, new FormatInfo(4, false, false, All.Srgb8, PixelFormat.Rgba, PixelType.UnsignedByte)); + Add(Format.R8G8B8A8Srgb, new FormatInfo(4, false, false, All.Srgb8Alpha8, PixelFormat.Rgba, PixelType.UnsignedByte)); + Add(Format.R4G4B4A4Unorm, new FormatInfo(4, true, false, All.Rgba4, PixelFormat.Rgba, PixelType.UnsignedShort4444Reversed)); + Add(Format.R5G5B5X1Unorm, new FormatInfo(4, true, false, All.Rgb5, PixelFormat.Rgb, PixelType.UnsignedShort1555Reversed)); + Add(Format.R5G5B5A1Unorm, new FormatInfo(4, true, false, All.Rgb5A1, PixelFormat.Rgba, PixelType.UnsignedShort1555Reversed)); + Add(Format.R5G6B5Unorm, new FormatInfo(3, true, false, All.Rgb565, PixelFormat.Rgb, PixelType.UnsignedShort565Reversed)); + Add(Format.R10G10B10A2Unorm, new FormatInfo(4, true, false, All.Rgb10A2, PixelFormat.Rgba, PixelType.UnsignedInt2101010Reversed)); + Add(Format.R10G10B10A2Uint, new FormatInfo(4, false, false, All.Rgb10A2ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt2101010Reversed)); + Add(Format.R11G11B10Float, new FormatInfo(3, false, false, All.R11fG11fB10f, PixelFormat.Rgb, PixelType.UnsignedInt10F11F11FRev)); + Add(Format.R9G9B9E5Float, new FormatInfo(3, false, false, All.Rgb9E5, PixelFormat.Rgb, PixelType.UnsignedInt5999Rev)); + Add(Format.Bc1RgbUnorm, new FormatInfo(2, true, false, All.CompressedRgbS3tcDxt1Ext)); + Add(Format.Bc1RgbaUnorm, new FormatInfo(1, true, false, All.CompressedRgbaS3tcDxt1Ext)); + Add(Format.Bc2Unorm, new FormatInfo(1, true, false, All.CompressedRgbaS3tcDxt3Ext)); + Add(Format.Bc3Unorm, new FormatInfo(1, true, false, All.CompressedRgbaS3tcDxt5Ext)); + Add(Format.Bc1RgbSrgb, new FormatInfo(2, false, false, All.CompressedSrgbS3tcDxt1Ext)); + Add(Format.Bc1RgbaSrgb, new FormatInfo(1, true, false, All.CompressedSrgbAlphaS3tcDxt1Ext)); + Add(Format.Bc2Srgb, new FormatInfo(1, false, false, All.CompressedSrgbAlphaS3tcDxt3Ext)); + Add(Format.Bc3Srgb, new FormatInfo(1, false, false, All.CompressedSrgbAlphaS3tcDxt5Ext)); + Add(Format.Bc4Unorm, new FormatInfo(1, true, false, All.CompressedRedRgtc1)); + Add(Format.Bc4Snorm, new FormatInfo(1, true, false, All.CompressedSignedRedRgtc1)); + Add(Format.Bc5Unorm, new FormatInfo(1, true, false, All.CompressedRgRgtc2)); + Add(Format.Bc5Snorm, new FormatInfo(1, true, false, All.CompressedSignedRgRgtc2)); + Add(Format.Bc7Unorm, new FormatInfo(1, true, false, All.CompressedRgbaBptcUnorm)); + Add(Format.Bc7Srgb, new FormatInfo(1, false, false, All.CompressedSrgbAlphaBptcUnorm)); + Add(Format.Bc6HSfloat, new FormatInfo(1, false, false, All.CompressedRgbBptcSignedFloat)); + Add(Format.Bc6HUfloat, new FormatInfo(1, false, false, All.CompressedRgbBptcUnsignedFloat)); + Add(Format.R8Uscaled, new FormatInfo(1, false, true, All.R8ui, PixelFormat.RedInteger, PixelType.UnsignedByte)); + Add(Format.R8Sscaled, new FormatInfo(1, false, true, All.R8i, PixelFormat.RedInteger, PixelType.Byte)); + Add(Format.R16Uscaled, new FormatInfo(1, false, true, All.R16ui, PixelFormat.RedInteger, PixelType.UnsignedShort)); + Add(Format.R16Sscaled, new FormatInfo(1, false, true, All.R16i, PixelFormat.RedInteger, PixelType.Short)); + Add(Format.R32Uscaled, new FormatInfo(1, false, true, All.R32ui, PixelFormat.RedInteger, PixelType.UnsignedInt)); + Add(Format.R32Sscaled, new FormatInfo(1, false, true, All.R32i, PixelFormat.RedInteger, PixelType.Int)); + Add(Format.R8G8Uscaled, new FormatInfo(2, false, true, All.Rg8ui, PixelFormat.RgInteger, PixelType.UnsignedByte)); + Add(Format.R8G8Sscaled, new FormatInfo(2, false, true, All.Rg8i, PixelFormat.RgInteger, PixelType.Byte)); + Add(Format.R16G16Uscaled, new FormatInfo(2, false, true, All.Rg16ui, PixelFormat.RgInteger, PixelType.UnsignedShort)); + Add(Format.R16G16Sscaled, new FormatInfo(2, false, true, All.Rg16i, PixelFormat.RgInteger, PixelType.Short)); + Add(Format.R32G32Uscaled, new FormatInfo(2, false, true, All.Rg32ui, PixelFormat.RgInteger, PixelType.UnsignedInt)); + Add(Format.R32G32Sscaled, new FormatInfo(2, false, true, All.Rg32i, PixelFormat.RgInteger, PixelType.Int)); + Add(Format.R8G8B8Uscaled, new FormatInfo(3, false, true, All.Rgb8ui, PixelFormat.RgbInteger, PixelType.UnsignedByte)); + Add(Format.R8G8B8Sscaled, new FormatInfo(3, false, true, All.Rgb8i, PixelFormat.RgbInteger, PixelType.Byte)); + Add(Format.R16G16B16Uscaled, new FormatInfo(3, false, true, All.Rgb16ui, PixelFormat.RgbInteger, PixelType.UnsignedShort)); + Add(Format.R16G16B16Sscaled, new FormatInfo(3, false, true, All.Rgb16i, PixelFormat.RgbInteger, PixelType.Short)); + Add(Format.R32G32B32Uscaled, new FormatInfo(3, false, true, All.Rgb32ui, PixelFormat.RgbInteger, PixelType.UnsignedInt)); + Add(Format.R32G32B32Sscaled, new FormatInfo(3, false, true, All.Rgb32i, PixelFormat.RgbInteger, PixelType.Int)); + Add(Format.R8G8B8A8Uscaled, new FormatInfo(4, false, true, All.Rgba8ui, PixelFormat.RgbaInteger, PixelType.UnsignedByte)); + Add(Format.R8G8B8A8Sscaled, new FormatInfo(4, false, true, All.Rgba8i, PixelFormat.RgbaInteger, PixelType.Byte)); + Add(Format.R16G16B16A16Uscaled, new FormatInfo(4, false, true, All.Rgba16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort)); + Add(Format.R16G16B16A16Sscaled, new FormatInfo(4, false, true, All.Rgba16i, PixelFormat.RgbaInteger, PixelType.Short)); + Add(Format.R32G32B32A32Uscaled, new FormatInfo(4, false, true, All.Rgba32ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt)); + Add(Format.R32G32B32A32Sscaled, new FormatInfo(4, false, true, All.Rgba32i, PixelFormat.RgbaInteger, PixelType.Int)); + Add(Format.R10G10B10A2Snorm, new FormatInfo(4, true, false, All.Rgb10A2, PixelFormat.Rgba, (PixelType)All.Int2101010Rev)); + Add(Format.R10G10B10A2Sint, new FormatInfo(4, false, false, All.Rgb10A2, PixelFormat.RgbaInteger, (PixelType)All.Int2101010Rev)); + Add(Format.R10G10B10A2Uscaled, new FormatInfo(4, false, true, All.Rgb10A2ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt2101010Reversed)); + Add(Format.R10G10B10A2Sscaled, new FormatInfo(4, false, true, All.Rgb10A2, PixelFormat.RgbaInteger, PixelType.UnsignedInt2101010Reversed)); + Add(Format.R8G8B8X8Unorm, new FormatInfo(4, true, false, All.Rgb8, PixelFormat.Rgba, PixelType.UnsignedByte)); + Add(Format.R8G8B8X8Snorm, new FormatInfo(4, true, false, All.Rgb8Snorm, PixelFormat.Rgba, PixelType.Byte)); + Add(Format.R8G8B8X8Uint, new FormatInfo(4, false, false, All.Rgb8ui, PixelFormat.RgbaInteger, PixelType.UnsignedByte)); + Add(Format.R8G8B8X8Sint, new FormatInfo(4, false, false, All.Rgb8i, PixelFormat.RgbaInteger, PixelType.Byte)); + Add(Format.R16G16B16X16Float, new FormatInfo(4, false, false, All.Rgb16f, PixelFormat.Rgba, PixelType.HalfFloat)); + Add(Format.R16G16B16X16Unorm, new FormatInfo(4, true, false, All.Rgb16, PixelFormat.Rgba, PixelType.UnsignedShort)); + Add(Format.R16G16B16X16Snorm, new FormatInfo(4, true, false, All.Rgb16Snorm, PixelFormat.Rgba, PixelType.Short)); + Add(Format.R16G16B16X16Uint, new FormatInfo(4, false, false, All.Rgb16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort)); + Add(Format.R16G16B16X16Sint, new FormatInfo(4, false, false, All.Rgb16i, PixelFormat.RgbaInteger, PixelType.Short)); + Add(Format.R32G32B32X32Float, new FormatInfo(4, false, false, All.Rgb32f, PixelFormat.Rgba, PixelType.Float)); + Add(Format.R32G32B32X32Uint, new FormatInfo(4, false, false, All.Rgb32ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt)); + Add(Format.R32G32B32X32Sint, new FormatInfo(4, false, false, All.Rgb32i, PixelFormat.RgbaInteger, PixelType.Int)); + Add(Format.Astc4x4Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc4X4Khr)); + Add(Format.Astc5x4Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc5X4Khr)); + Add(Format.Astc5x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc5X5Khr)); + Add(Format.Astc6x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc6X5Khr)); + Add(Format.Astc6x6Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc6X6Khr)); + Add(Format.Astc8x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc8X5Khr)); + Add(Format.Astc8x6Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc8X6Khr)); + Add(Format.Astc8x8Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc8X8Khr)); + Add(Format.Astc10x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X5Khr)); + Add(Format.Astc10x6Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X6Khr)); + Add(Format.Astc10x8Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X8Khr)); + Add(Format.Astc10x10Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X10Khr)); + Add(Format.Astc12x10Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc12X10Khr)); + Add(Format.Astc12x12Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc12X12Khr)); + Add(Format.Astc4x4Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc4X4Khr)); + Add(Format.Astc5x4Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc5X4Khr)); + Add(Format.Astc5x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc5X5Khr)); + Add(Format.Astc6x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc6X5Khr)); + Add(Format.Astc6x6Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc6X6Khr)); + Add(Format.Astc8x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc8X5Khr)); + Add(Format.Astc8x6Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc8X6Khr)); + Add(Format.Astc8x8Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc8X8Khr)); + Add(Format.Astc10x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X5Khr)); + Add(Format.Astc10x6Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X6Khr)); + Add(Format.Astc10x8Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X8Khr)); + Add(Format.Astc10x10Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X10Khr)); + Add(Format.Astc12x10Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc12X10Khr)); + Add(Format.Astc12x12Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc12X12Khr)); + Add(Format.B5G6R5Unorm, new FormatInfo(3, true, false, All.Rgb565, PixelFormat.Bgr, PixelType.UnsignedShort565)); + Add(Format.B5G5R5X1Unorm, new FormatInfo(4, true, false, All.Rgb5, PixelFormat.Bgra, PixelType.UnsignedShort5551)); + Add(Format.B5G5R5A1Unorm, new FormatInfo(4, true, false, All.Rgb5A1, PixelFormat.Bgra, PixelType.UnsignedShort5551)); + Add(Format.A1B5G5R5Unorm, new FormatInfo(4, true, false, All.Rgb5A1, PixelFormat.Bgra, PixelType.UnsignedShort1555Reversed)); + Add(Format.B8G8R8X8Unorm, new FormatInfo(4, true, false, All.Rgba8, PixelFormat.Bgra, PixelType.UnsignedByte)); + Add(Format.B8G8R8A8Unorm, new FormatInfo(4, true, false, All.Rgba8, PixelFormat.Bgra, PixelType.UnsignedByte)); + Add(Format.B8G8R8X8Srgb, new FormatInfo(4, false, false, All.Srgb8, PixelFormat.BgraInteger, PixelType.UnsignedByte)); + Add(Format.B8G8R8A8Srgb, new FormatInfo(4, false, false, All.Srgb8Alpha8, PixelFormat.BgraInteger, PixelType.UnsignedByte)); + } + + private static void Add(Format format, FormatInfo info) + { + _table[(int)format] = info; + } + + public static FormatInfo GetFormatInfo(Format format) + { + return _table[(int)format]; + } + } +} diff --git a/Ryujinx.Graphics.OpenGL/Formats/FormatInfo.cs b/Ryujinx.Graphics.OpenGL/Formats/FormatInfo.cs deleted file mode 100644 index a1fd723f..00000000 --- a/Ryujinx.Graphics.OpenGL/Formats/FormatInfo.cs +++ /dev/null @@ -1,45 +0,0 @@ -using OpenTK.Graphics.OpenGL; - -namespace Ryujinx.Graphics.OpenGL.Formats -{ - struct FormatInfo - { - public int Components { get; } - public bool Normalized { get; } - public bool Scaled { get; } - - public PixelInternalFormat PixelInternalFormat { get; } - public PixelFormat PixelFormat { get; } - public PixelType PixelType { get; } - - public bool IsCompressed { get; } - - public FormatInfo( - int components, - bool normalized, - bool scaled, - All pixelInternalFormat, - PixelFormat pixelFormat, - PixelType pixelType) - { - Components = components; - Normalized = normalized; - Scaled = scaled; - PixelInternalFormat = (PixelInternalFormat)pixelInternalFormat; - PixelFormat = pixelFormat; - PixelType = pixelType; - IsCompressed = false; - } - - public FormatInfo(int components, bool normalized, bool scaled, All pixelFormat) - { - Components = components; - Normalized = normalized; - Scaled = scaled; - PixelInternalFormat = 0; - PixelFormat = (PixelFormat)pixelFormat; - PixelType = 0; - IsCompressed = true; - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Formats/FormatTable.cs b/Ryujinx.Graphics.OpenGL/Formats/FormatTable.cs deleted file mode 100644 index b67fe5c4..00000000 --- a/Ryujinx.Graphics.OpenGL/Formats/FormatTable.cs +++ /dev/null @@ -1,183 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Graphics.GAL; -using System; - -namespace Ryujinx.Graphics.OpenGL.Formats -{ - struct FormatTable - { - private static FormatInfo[] _table; - - static FormatTable() - { - _table = new FormatInfo[Enum.GetNames(typeof(Format)).Length]; - - Add(Format.R8Unorm, new FormatInfo(1, true, false, All.R8, PixelFormat.Red, PixelType.UnsignedByte)); - Add(Format.R8Snorm, new FormatInfo(1, true, false, All.R8Snorm, PixelFormat.Red, PixelType.Byte)); - Add(Format.R8Uint, new FormatInfo(1, false, false, All.R8ui, PixelFormat.RedInteger, PixelType.UnsignedByte)); - Add(Format.R8Sint, new FormatInfo(1, false, false, All.R8i, PixelFormat.RedInteger, PixelType.Byte)); - Add(Format.R16Float, new FormatInfo(1, false, false, All.R16f, PixelFormat.Red, PixelType.HalfFloat)); - Add(Format.R16Unorm, new FormatInfo(1, true, false, All.R16, PixelFormat.Red, PixelType.UnsignedShort)); - Add(Format.R16Snorm, new FormatInfo(1, true, false, All.R16Snorm, PixelFormat.Red, PixelType.Short)); - Add(Format.R16Uint, new FormatInfo(1, false, false, All.R16ui, PixelFormat.RedInteger, PixelType.UnsignedShort)); - Add(Format.R16Sint, new FormatInfo(1, false, false, All.R16i, PixelFormat.RedInteger, PixelType.Short)); - Add(Format.R32Float, new FormatInfo(1, false, false, All.R32f, PixelFormat.Red, PixelType.Float)); - Add(Format.R32Uint, new FormatInfo(1, false, false, All.R32ui, PixelFormat.RedInteger, PixelType.UnsignedInt)); - Add(Format.R32Sint, new FormatInfo(1, false, false, All.R32i, PixelFormat.RedInteger, PixelType.Int)); - Add(Format.R8G8Unorm, new FormatInfo(2, true, false, All.Rg8, PixelFormat.Rg, PixelType.UnsignedByte)); - Add(Format.R8G8Snorm, new FormatInfo(2, true, false, All.Rg8Snorm, PixelFormat.Rg, PixelType.Byte)); - Add(Format.R8G8Uint, new FormatInfo(2, false, false, All.Rg8ui, PixelFormat.RgInteger, PixelType.UnsignedByte)); - Add(Format.R8G8Sint, new FormatInfo(2, false, false, All.Rg8i, PixelFormat.RgInteger, PixelType.Byte)); - Add(Format.R16G16Float, new FormatInfo(2, false, false, All.Rg16f, PixelFormat.Rg, PixelType.HalfFloat)); - Add(Format.R16G16Unorm, new FormatInfo(2, true, false, All.Rg16, PixelFormat.Rg, PixelType.UnsignedShort)); - Add(Format.R16G16Snorm, new FormatInfo(2, true, false, All.Rg16Snorm, PixelFormat.Rg, PixelType.Short)); - Add(Format.R16G16Uint, new FormatInfo(2, false, false, All.Rg16ui, PixelFormat.RgInteger, PixelType.UnsignedShort)); - Add(Format.R16G16Sint, new FormatInfo(2, false, false, All.Rg16i, PixelFormat.RgInteger, PixelType.Short)); - Add(Format.R32G32Float, new FormatInfo(2, false, false, All.Rg32f, PixelFormat.Rg, PixelType.Float)); - Add(Format.R32G32Uint, new FormatInfo(2, false, false, All.Rg32ui, PixelFormat.RgInteger, PixelType.UnsignedInt)); - Add(Format.R32G32Sint, new FormatInfo(2, false, false, All.Rg32i, PixelFormat.RgInteger, PixelType.Int)); - Add(Format.R8G8B8Unorm, new FormatInfo(3, true, false, All.Rgb8, PixelFormat.Rgb, PixelType.UnsignedByte)); - Add(Format.R8G8B8Snorm, new FormatInfo(3, true, false, All.Rgb8Snorm, PixelFormat.Rgb, PixelType.Byte)); - Add(Format.R8G8B8Uint, new FormatInfo(3, false, false, All.Rgb8ui, PixelFormat.RgbInteger, PixelType.UnsignedByte)); - Add(Format.R8G8B8Sint, new FormatInfo(3, false, false, All.Rgb8i, PixelFormat.RgbInteger, PixelType.Byte)); - Add(Format.R16G16B16Float, new FormatInfo(3, false, false, All.Rgb16f, PixelFormat.Rgb, PixelType.HalfFloat)); - Add(Format.R16G16B16Unorm, new FormatInfo(3, true, false, All.Rgb16, PixelFormat.Rgb, PixelType.UnsignedShort)); - Add(Format.R16G16B16Snorm, new FormatInfo(3, true, false, All.Rgb16Snorm, PixelFormat.Rgb, PixelType.Short)); - Add(Format.R16G16B16Uint, new FormatInfo(3, false, false, All.Rgb16ui, PixelFormat.RgbInteger, PixelType.UnsignedShort)); - Add(Format.R16G16B16Sint, new FormatInfo(3, false, false, All.Rgb16i, PixelFormat.RgbInteger, PixelType.Short)); - Add(Format.R32G32B32Float, new FormatInfo(3, false, false, All.Rgb32f, PixelFormat.Rgb, PixelType.Float)); - Add(Format.R32G32B32Uint, new FormatInfo(3, false, false, All.Rgb32ui, PixelFormat.RgbInteger, PixelType.UnsignedInt)); - Add(Format.R32G32B32Sint, new FormatInfo(3, false, false, All.Rgb32i, PixelFormat.RgbInteger, PixelType.Int)); - Add(Format.R8G8B8A8Unorm, new FormatInfo(4, true, false, All.Rgba8, PixelFormat.Rgba, PixelType.UnsignedByte)); - Add(Format.R8G8B8A8Snorm, new FormatInfo(4, true, false, All.Rgba8Snorm, PixelFormat.Rgba, PixelType.Byte)); - Add(Format.R8G8B8A8Uint, new FormatInfo(4, false, false, All.Rgba8ui, PixelFormat.RgbaInteger, PixelType.UnsignedByte)); - Add(Format.R8G8B8A8Sint, new FormatInfo(4, false, false, All.Rgba8i, PixelFormat.RgbaInteger, PixelType.Byte)); - Add(Format.R16G16B16A16Float, new FormatInfo(4, false, false, All.Rgba16f, PixelFormat.Rgba, PixelType.HalfFloat)); - Add(Format.R16G16B16A16Unorm, new FormatInfo(4, true, false, All.Rgba16, PixelFormat.Rgba, PixelType.UnsignedShort)); - Add(Format.R16G16B16A16Snorm, new FormatInfo(4, true, false, All.Rgba16Snorm, PixelFormat.Rgba, PixelType.Short)); - Add(Format.R16G16B16A16Uint, new FormatInfo(4, false, false, All.Rgba16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort)); - Add(Format.R16G16B16A16Sint, new FormatInfo(4, false, false, All.Rgba16i, PixelFormat.RgbaInteger, PixelType.Short)); - Add(Format.R32G32B32A32Float, new FormatInfo(4, false, false, All.Rgba32f, PixelFormat.Rgba, PixelType.Float)); - Add(Format.R32G32B32A32Uint, new FormatInfo(4, false, false, All.Rgba32ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt)); - Add(Format.R32G32B32A32Sint, new FormatInfo(4, false, false, All.Rgba32i, PixelFormat.RgbaInteger, PixelType.Int)); - Add(Format.S8Uint, new FormatInfo(1, false, false, All.StencilIndex8, PixelFormat.StencilIndex, PixelType.UnsignedByte)); - Add(Format.D16Unorm, new FormatInfo(1, false, false, All.DepthComponent16, PixelFormat.DepthComponent, PixelType.UnsignedShort)); - Add(Format.D24X8Unorm, new FormatInfo(1, false, false, All.DepthComponent24, PixelFormat.DepthComponent, PixelType.UnsignedInt)); - Add(Format.D32Float, new FormatInfo(1, false, false, All.DepthComponent32f, PixelFormat.DepthComponent, PixelType.Float)); - Add(Format.D24UnormS8Uint, new FormatInfo(1, false, false, All.Depth24Stencil8, PixelFormat.DepthStencil, PixelType.UnsignedInt248)); - Add(Format.D32FloatS8Uint, new FormatInfo(1, false, false, All.Depth32fStencil8, PixelFormat.DepthStencil, PixelType.Float32UnsignedInt248Rev)); - Add(Format.R8G8B8X8Srgb, new FormatInfo(4, false, false, All.Srgb8, PixelFormat.Rgba, PixelType.UnsignedByte)); - Add(Format.R8G8B8A8Srgb, new FormatInfo(4, false, false, All.Srgb8Alpha8, PixelFormat.Rgba, PixelType.UnsignedByte)); - Add(Format.R4G4B4A4Unorm, new FormatInfo(4, true, false, All.Rgba4, PixelFormat.Rgba, PixelType.UnsignedShort4444Reversed)); - Add(Format.R5G5B5X1Unorm, new FormatInfo(4, true, false, All.Rgb5, PixelFormat.Rgb, PixelType.UnsignedShort1555Reversed)); - Add(Format.R5G5B5A1Unorm, new FormatInfo(4, true, false, All.Rgb5A1, PixelFormat.Rgba, PixelType.UnsignedShort1555Reversed)); - Add(Format.R5G6B5Unorm, new FormatInfo(3, true, false, All.Rgb565, PixelFormat.Rgb, PixelType.UnsignedShort565Reversed)); - Add(Format.R10G10B10A2Unorm, new FormatInfo(4, true, false, All.Rgb10A2, PixelFormat.Rgba, PixelType.UnsignedInt2101010Reversed)); - Add(Format.R10G10B10A2Uint, new FormatInfo(4, false, false, All.Rgb10A2ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt2101010Reversed)); - Add(Format.R11G11B10Float, new FormatInfo(3, false, false, All.R11fG11fB10f, PixelFormat.Rgb, PixelType.UnsignedInt10F11F11FRev)); - Add(Format.R9G9B9E5Float, new FormatInfo(3, false, false, All.Rgb9E5, PixelFormat.Rgb, PixelType.UnsignedInt5999Rev)); - Add(Format.Bc1RgbUnorm, new FormatInfo(2, true, false, All.CompressedRgbS3tcDxt1Ext)); - Add(Format.Bc1RgbaUnorm, new FormatInfo(1, true, false, All.CompressedRgbaS3tcDxt1Ext)); - Add(Format.Bc2Unorm, new FormatInfo(1, true, false, All.CompressedRgbaS3tcDxt3Ext)); - Add(Format.Bc3Unorm, new FormatInfo(1, true, false, All.CompressedRgbaS3tcDxt5Ext)); - Add(Format.Bc1RgbSrgb, new FormatInfo(2, false, false, All.CompressedSrgbS3tcDxt1Ext)); - Add(Format.Bc1RgbaSrgb, new FormatInfo(1, true, false, All.CompressedSrgbAlphaS3tcDxt1Ext)); - Add(Format.Bc2Srgb, new FormatInfo(1, false, false, All.CompressedSrgbAlphaS3tcDxt3Ext)); - Add(Format.Bc3Srgb, new FormatInfo(1, false, false, All.CompressedSrgbAlphaS3tcDxt5Ext)); - Add(Format.Bc4Unorm, new FormatInfo(1, true, false, All.CompressedRedRgtc1)); - Add(Format.Bc4Snorm, new FormatInfo(1, true, false, All.CompressedSignedRedRgtc1)); - Add(Format.Bc5Unorm, new FormatInfo(1, true, false, All.CompressedRgRgtc2)); - Add(Format.Bc5Snorm, new FormatInfo(1, true, false, All.CompressedSignedRgRgtc2)); - Add(Format.Bc7Unorm, new FormatInfo(1, true, false, All.CompressedRgbaBptcUnorm)); - Add(Format.Bc7Srgb, new FormatInfo(1, false, false, All.CompressedSrgbAlphaBptcUnorm)); - Add(Format.Bc6HSfloat, new FormatInfo(1, false, false, All.CompressedRgbBptcSignedFloat)); - Add(Format.Bc6HUfloat, new FormatInfo(1, false, false, All.CompressedRgbBptcUnsignedFloat)); - Add(Format.R8Uscaled, new FormatInfo(1, false, true, All.R8ui, PixelFormat.RedInteger, PixelType.UnsignedByte)); - Add(Format.R8Sscaled, new FormatInfo(1, false, true, All.R8i, PixelFormat.RedInteger, PixelType.Byte)); - Add(Format.R16Uscaled, new FormatInfo(1, false, true, All.R16ui, PixelFormat.RedInteger, PixelType.UnsignedShort)); - Add(Format.R16Sscaled, new FormatInfo(1, false, true, All.R16i, PixelFormat.RedInteger, PixelType.Short)); - Add(Format.R32Uscaled, new FormatInfo(1, false, true, All.R32ui, PixelFormat.RedInteger, PixelType.UnsignedInt)); - Add(Format.R32Sscaled, new FormatInfo(1, false, true, All.R32i, PixelFormat.RedInteger, PixelType.Int)); - Add(Format.R8G8Uscaled, new FormatInfo(2, false, true, All.Rg8ui, PixelFormat.RgInteger, PixelType.UnsignedByte)); - Add(Format.R8G8Sscaled, new FormatInfo(2, false, true, All.Rg8i, PixelFormat.RgInteger, PixelType.Byte)); - Add(Format.R16G16Uscaled, new FormatInfo(2, false, true, All.Rg16ui, PixelFormat.RgInteger, PixelType.UnsignedShort)); - Add(Format.R16G16Sscaled, new FormatInfo(2, false, true, All.Rg16i, PixelFormat.RgInteger, PixelType.Short)); - Add(Format.R32G32Uscaled, new FormatInfo(2, false, true, All.Rg32ui, PixelFormat.RgInteger, PixelType.UnsignedInt)); - Add(Format.R32G32Sscaled, new FormatInfo(2, false, true, All.Rg32i, PixelFormat.RgInteger, PixelType.Int)); - Add(Format.R8G8B8Uscaled, new FormatInfo(3, false, true, All.Rgb8ui, PixelFormat.RgbInteger, PixelType.UnsignedByte)); - Add(Format.R8G8B8Sscaled, new FormatInfo(3, false, true, All.Rgb8i, PixelFormat.RgbInteger, PixelType.Byte)); - Add(Format.R16G16B16Uscaled, new FormatInfo(3, false, true, All.Rgb16ui, PixelFormat.RgbInteger, PixelType.UnsignedShort)); - Add(Format.R16G16B16Sscaled, new FormatInfo(3, false, true, All.Rgb16i, PixelFormat.RgbInteger, PixelType.Short)); - Add(Format.R32G32B32Uscaled, new FormatInfo(3, false, true, All.Rgb32ui, PixelFormat.RgbInteger, PixelType.UnsignedInt)); - Add(Format.R32G32B32Sscaled, new FormatInfo(3, false, true, All.Rgb32i, PixelFormat.RgbInteger, PixelType.Int)); - Add(Format.R8G8B8A8Uscaled, new FormatInfo(4, false, true, All.Rgba8ui, PixelFormat.RgbaInteger, PixelType.UnsignedByte)); - Add(Format.R8G8B8A8Sscaled, new FormatInfo(4, false, true, All.Rgba8i, PixelFormat.RgbaInteger, PixelType.Byte)); - Add(Format.R16G16B16A16Uscaled, new FormatInfo(4, false, true, All.Rgba16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort)); - Add(Format.R16G16B16A16Sscaled, new FormatInfo(4, false, true, All.Rgba16i, PixelFormat.RgbaInteger, PixelType.Short)); - Add(Format.R32G32B32A32Uscaled, new FormatInfo(4, false, true, All.Rgba32ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt)); - Add(Format.R32G32B32A32Sscaled, new FormatInfo(4, false, true, All.Rgba32i, PixelFormat.RgbaInteger, PixelType.Int)); - Add(Format.R10G10B10A2Snorm, new FormatInfo(4, true, false, All.Rgb10A2, PixelFormat.Rgba, (PixelType)All.Int2101010Rev)); - Add(Format.R10G10B10A2Sint, new FormatInfo(4, false, false, All.Rgb10A2, PixelFormat.RgbaInteger, (PixelType)All.Int2101010Rev)); - Add(Format.R10G10B10A2Uscaled, new FormatInfo(4, false, true, All.Rgb10A2ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt2101010Reversed)); - Add(Format.R10G10B10A2Sscaled, new FormatInfo(4, false, true, All.Rgb10A2, PixelFormat.RgbaInteger, PixelType.UnsignedInt2101010Reversed)); - Add(Format.R8G8B8X8Unorm, new FormatInfo(4, true, false, All.Rgb8, PixelFormat.Rgba, PixelType.UnsignedByte)); - Add(Format.R8G8B8X8Snorm, new FormatInfo(4, true, false, All.Rgb8Snorm, PixelFormat.Rgba, PixelType.Byte)); - Add(Format.R8G8B8X8Uint, new FormatInfo(4, false, false, All.Rgb8ui, PixelFormat.RgbaInteger, PixelType.UnsignedByte)); - Add(Format.R8G8B8X8Sint, new FormatInfo(4, false, false, All.Rgb8i, PixelFormat.RgbaInteger, PixelType.Byte)); - Add(Format.R16G16B16X16Float, new FormatInfo(4, false, false, All.Rgb16f, PixelFormat.Rgba, PixelType.HalfFloat)); - Add(Format.R16G16B16X16Unorm, new FormatInfo(4, true, false, All.Rgb16, PixelFormat.Rgba, PixelType.UnsignedShort)); - Add(Format.R16G16B16X16Snorm, new FormatInfo(4, true, false, All.Rgb16Snorm, PixelFormat.Rgba, PixelType.Short)); - Add(Format.R16G16B16X16Uint, new FormatInfo(4, false, false, All.Rgb16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort)); - Add(Format.R16G16B16X16Sint, new FormatInfo(4, false, false, All.Rgb16i, PixelFormat.RgbaInteger, PixelType.Short)); - Add(Format.R32G32B32X32Float, new FormatInfo(4, false, false, All.Rgb32f, PixelFormat.Rgba, PixelType.Float)); - Add(Format.R32G32B32X32Uint, new FormatInfo(4, false, false, All.Rgb32ui, PixelFormat.RgbaInteger, PixelType.UnsignedInt)); - Add(Format.R32G32B32X32Sint, new FormatInfo(4, false, false, All.Rgb32i, PixelFormat.RgbaInteger, PixelType.Int)); - Add(Format.Astc4x4Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc4X4Khr)); - Add(Format.Astc5x4Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc5X4Khr)); - Add(Format.Astc5x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc5X5Khr)); - Add(Format.Astc6x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc6X5Khr)); - Add(Format.Astc6x6Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc6X6Khr)); - Add(Format.Astc8x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc8X5Khr)); - Add(Format.Astc8x6Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc8X6Khr)); - Add(Format.Astc8x8Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc8X8Khr)); - Add(Format.Astc10x5Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X5Khr)); - Add(Format.Astc10x6Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X6Khr)); - Add(Format.Astc10x8Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X8Khr)); - Add(Format.Astc10x10Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc10X10Khr)); - Add(Format.Astc12x10Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc12X10Khr)); - Add(Format.Astc12x12Unorm, new FormatInfo(1, true, false, All.CompressedRgbaAstc12X12Khr)); - Add(Format.Astc4x4Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc4X4Khr)); - Add(Format.Astc5x4Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc5X4Khr)); - Add(Format.Astc5x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc5X5Khr)); - Add(Format.Astc6x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc6X5Khr)); - Add(Format.Astc6x6Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc6X6Khr)); - Add(Format.Astc8x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc8X5Khr)); - Add(Format.Astc8x6Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc8X6Khr)); - Add(Format.Astc8x8Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc8X8Khr)); - Add(Format.Astc10x5Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X5Khr)); - Add(Format.Astc10x6Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X6Khr)); - Add(Format.Astc10x8Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X8Khr)); - Add(Format.Astc10x10Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc10X10Khr)); - Add(Format.Astc12x10Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc12X10Khr)); - Add(Format.Astc12x12Srgb, new FormatInfo(1, false, false, All.CompressedSrgb8Alpha8Astc12X12Khr)); - Add(Format.B5G6R5Unorm, new FormatInfo(3, true, false, All.Rgb565, PixelFormat.Bgr, PixelType.UnsignedShort565)); - Add(Format.B5G5R5X1Unorm, new FormatInfo(4, true, false, All.Rgb5, PixelFormat.Bgra, PixelType.UnsignedShort5551)); - Add(Format.B5G5R5A1Unorm, new FormatInfo(4, true, false, All.Rgb5A1, PixelFormat.Bgra, PixelType.UnsignedShort5551)); - Add(Format.A1B5G5R5Unorm, new FormatInfo(4, true, false, All.Rgb5A1, PixelFormat.Bgra, PixelType.UnsignedShort1555Reversed)); - Add(Format.B8G8R8X8Unorm, new FormatInfo(4, true, false, All.Rgba8, PixelFormat.Bgra, PixelType.UnsignedByte)); - Add(Format.B8G8R8A8Unorm, new FormatInfo(4, true, false, All.Rgba8, PixelFormat.Bgra, PixelType.UnsignedByte)); - Add(Format.B8G8R8X8Srgb, new FormatInfo(4, false, false, All.Srgb8, PixelFormat.BgraInteger, PixelType.UnsignedByte)); - Add(Format.B8G8R8A8Srgb, new FormatInfo(4, false, false, All.Srgb8Alpha8, PixelFormat.BgraInteger, PixelType.UnsignedByte)); - } - - private static void Add(Format format, FormatInfo info) - { - _table[(int)format] = info; - } - - public static FormatInfo GetFormatInfo(Format format) - { - return _table[(int)format]; - } - } -} diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index 9b1fec33..64705862 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -1,10 +1,10 @@ using OpenTK.Graphics.OpenGL; +using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL.Blend; using Ryujinx.Graphics.GAL.Color; using Ryujinx.Graphics.GAL.DepthStencil; using Ryujinx.Graphics.GAL.InputAssembler; -using Ryujinx.Graphics.OpenGL.Formats; using Ryujinx.Graphics.Shader; using System; @@ -114,6 +114,10 @@ namespace Ryujinx.Graphics.OpenGL { ((Sampler)sampler).Bind(unit); } + else if (unit == -1) + { + Logger.PrintError(LogClass.Gpu, $"Invalid binding point: {stage} {index}."); + } } public void BindTexture(int index, ShaderStage stage, ITexture texture) @@ -131,6 +135,10 @@ namespace Ryujinx.Graphics.OpenGL ((TextureView)texture).Bind(unit); } } + else if (unit == -1) + { + Logger.PrintError(LogClass.Gpu, $"Invalid binding point: {stage} {index}."); + } } public void BindStorageBuffer(int index, ShaderStage stage, BufferRange buffer) @@ -151,6 +159,8 @@ namespace Ryujinx.Graphics.OpenGL if (bindingPoint == -1) { + Logger.PrintError(LogClass.Gpu, $"Invalid binding point: {stage} {index}."); + return; } @@ -289,6 +299,8 @@ namespace Ryujinx.Graphics.OpenGL { if (!_program.IsLinked) { + Logger.PrintError(LogClass.Gpu, "Dispatch error, shader not linked."); + return; } @@ -301,6 +313,8 @@ namespace Ryujinx.Graphics.OpenGL { if (!_program.IsLinked) { + Logger.PrintError(LogClass.Gpu, "Draw error, shader not linked."); + return; } @@ -407,13 +421,13 @@ namespace Ryujinx.Graphics.OpenGL { if (!_program.IsLinked) { + Logger.PrintError(LogClass.Gpu, "Draw error, shader not linked."); + return; } PrepareForDraw(); - int firstIndexOffset = firstIndex; - int indexElemSize = 1; switch (_elementsType) @@ -450,7 +464,6 @@ namespace Ryujinx.Graphics.OpenGL indexCount, instanceCount, indexBaseOffset, - indexElemSize, firstVertex, firstInstance); } @@ -536,7 +549,6 @@ namespace Ryujinx.Graphics.OpenGL int indexCount, int instanceCount, IntPtr indexBaseOffset, - int indexElemSize, int firstVertex, int firstInstance) { diff --git a/Ryujinx.Graphics.OpenGL/Program.cs b/Ryujinx.Graphics.OpenGL/Program.cs index 820910a9..be1cc7de 100644 --- a/Ryujinx.Graphics.OpenGL/Program.cs +++ b/Ryujinx.Graphics.OpenGL/Program.cs @@ -1,6 +1,7 @@ +using OpenTK.Graphics.OpenGL; +using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Shader; -using OpenTK.Graphics.OpenGL; namespace Ryujinx.Graphics.OpenGL { @@ -190,13 +191,11 @@ namespace Ryujinx.Graphics.OpenGL private void CheckProgramLink() { - int status = 0; - - GL.GetProgram(Handle, GetProgramParameterName.LinkStatus, out status); + GL.GetProgram(Handle, GetProgramParameterName.LinkStatus, out int status); if (status == 0) { - // throw new System.Exception(GL.GetProgramInfoLog(Handle)); + Logger.PrintError(LogClass.Gpu, $"Shader linking failed: {GL.GetProgramInfoLog(Handle)}"); } else { diff --git a/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj b/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj index 484e8682..e4343215 100644 --- a/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj +++ b/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj @@ -10,6 +10,7 @@ + diff --git a/Ryujinx.Graphics.OpenGL/TextureStorage.cs b/Ryujinx.Graphics.OpenGL/TextureStorage.cs index d74b0a8e..482189ca 100644 --- a/Ryujinx.Graphics.OpenGL/TextureStorage.cs +++ b/Ryujinx.Graphics.OpenGL/TextureStorage.cs @@ -1,7 +1,7 @@ +using OpenTK.Graphics.OpenGL; +using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL.Texture; -using Ryujinx.Graphics.OpenGL.Formats; -using OpenTK.Graphics.OpenGL; namespace Ryujinx.Graphics.OpenGL { @@ -135,13 +135,15 @@ namespace Ryujinx.Graphics.OpenGL _info.Height, _info.Depth); break; + + default: + Logger.PrintError(LogClass.Gpu, $"Invalid or unsupported texture target: {target}."); + break; } } public ITexture CreateDefaultView() { - int layers = _info.GetLayers(); - return CreateView(_info, 0, 0); } diff --git a/Ryujinx.Graphics.OpenGL/TextureView.cs b/Ryujinx.Graphics.OpenGL/TextureView.cs index 769f0339..2fd23d4c 100644 --- a/Ryujinx.Graphics.OpenGL/TextureView.cs +++ b/Ryujinx.Graphics.OpenGL/TextureView.cs @@ -1,7 +1,6 @@ +using OpenTK.Graphics.OpenGL; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL.Texture; -using Ryujinx.Graphics.OpenGL.Formats; -using OpenTK.Graphics.OpenGL; using System; namespace Ryujinx.Graphics.OpenGL diff --git a/Ryujinx.Graphics.OpenGL/VertexArray.cs b/Ryujinx.Graphics.OpenGL/VertexArray.cs index cf87c953..c3c37813 100644 --- a/Ryujinx.Graphics.OpenGL/VertexArray.cs +++ b/Ryujinx.Graphics.OpenGL/VertexArray.cs @@ -1,6 +1,5 @@ using OpenTK.Graphics.OpenGL; using Ryujinx.Graphics.GAL.InputAssembler; -using Ryujinx.Graphics.OpenGL.Formats; using System; namespace Ryujinx.Graphics.OpenGL -- cgit v1.2.3