From c1c0ccbaf598cb0f85ff84306faec41f2d7984b4 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 8 May 2024 22:00:37 -0400 Subject: [PATCH] Trivial renames --- Directory.Packages.props | 5 +- src/Ryujinx.Graphics.OpenGL/Buffer.cs | 44 ++--- src/Ryujinx.Graphics.OpenGL/Debugger.cs | 16 +- .../DrawTextureEmulation.cs | 2 +- .../Effects/FsrScalingFilter.cs | 10 +- .../Effects/FxaaPostProcessingEffect.cs | 2 +- .../Effects/ShaderHelper.cs | 2 +- .../Effects/SmaaPostProcessingEffect.cs | 14 +- src/Ryujinx.Graphics.OpenGL/EnumConversion.cs | 158 +++++++++--------- src/Ryujinx.Graphics.OpenGL/Framebuffer.cs | 6 +- src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs | 12 +- .../Image/ImageArray.cs | 7 +- src/Ryujinx.Graphics.OpenGL/Image/Sampler.cs | 26 +-- .../Image/TextureBase.cs | 2 +- .../Image/TextureBuffer.cs | 6 +- .../Image/TextureCopy.cs | 38 ++--- .../Image/TextureCopyIncompatible.cs | 12 +- .../Image/TextureCopyMS.cs | 14 +- .../Image/TextureStorage.cs | 22 +-- .../Image/TextureView.cs | 16 +- src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs | 4 +- .../PersistentBuffers.cs | 32 ++-- src/Ryujinx.Graphics.OpenGL/Pipeline.cs | 16 +- src/Ryujinx.Graphics.OpenGL/Program.cs | 2 +- .../Queries/BufferedQuery.cs | 16 +- .../Queries/CounterQueue.cs | 2 +- .../Queries/CounterQueueEvent.cs | 4 +- .../Ryujinx.Graphics.OpenGL.csproj | 3 +- src/Ryujinx.Graphics.OpenGL/Sync.cs | 2 +- src/Ryujinx.Graphics.OpenGL/VertexArray.cs | 8 +- src/Ryujinx.Graphics.OpenGL/Window.cs | 2 +- src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj | 1 - src/Ryujinx.Gtk3/UI/OpenGLRenderer.cs | 2 +- src/Ryujinx.Gtk3/UI/SPBOpenGLContext.cs | 2 +- .../OpenGL/OpenGLWindow.cs | 2 +- 35 files changed, 256 insertions(+), 256 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ef274125a..5e68c0244 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,7 +28,6 @@ - @@ -39,6 +38,8 @@ + + @@ -49,4 +50,4 @@ - + \ No newline at end of file diff --git a/src/Ryujinx.Graphics.OpenGL/Buffer.cs b/src/Ryujinx.Graphics.OpenGL/Buffer.cs index 2a5143101..d464172c6 100644 --- a/src/Ryujinx.Graphics.OpenGL/Buffer.cs +++ b/src/Ryujinx.Graphics.OpenGL/Buffer.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using System; @@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.OpenGL { public static void Clear(BufferHandle destination, int offset, int size, uint value) { - GL.BindBuffer(BufferTarget.CopyWriteBuffer, destination.ToInt32()); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, destination.ToInt32()); unsafe { @@ -17,8 +17,8 @@ namespace Ryujinx.Graphics.OpenGL valueArr[0] = value; GL.ClearBufferSubData( - BufferTarget.CopyWriteBuffer, - PixelInternalFormat.Rgba8ui, + BufferTargetARB.CopyWriteBuffer, + InternalFormat.Rgba8ui, (IntPtr)offset, (IntPtr)size, PixelFormat.RgbaInteger, @@ -36,8 +36,8 @@ namespace Ryujinx.Graphics.OpenGL { int handle = GL.GenBuffer(); - GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle); - GL.BufferData(BufferTarget.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageHint.DynamicDraw); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle); + GL.BufferData(BufferTargetARB.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageARB.DynamicDraw); return Handle.FromInt32(handle); } @@ -46,24 +46,24 @@ namespace Ryujinx.Graphics.OpenGL { int handle = GL.GenBuffer(); - GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle); - GL.BufferStorage(BufferTarget.CopyWriteBuffer, size, IntPtr.Zero, - BufferStorageFlags.MapPersistentBit | - BufferStorageFlags.MapCoherentBit | - BufferStorageFlags.ClientStorageBit | - BufferStorageFlags.MapReadBit); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle); + GL.BufferStorage(BufferTargetARB.CopyWriteBuffer, size, IntPtr.Zero, + BufferStorageMask.MapPersistentBit | + BufferStorageMask.MapCoherentBit | + BufferStorageMask.ClientStorageBit | + BufferStorageMask.MapReadBit); return Handle.FromInt32(handle); } public static void Copy(BufferHandle source, BufferHandle destination, int srcOffset, int dstOffset, int size) { - GL.BindBuffer(BufferTarget.CopyReadBuffer, source.ToInt32()); - GL.BindBuffer(BufferTarget.CopyWriteBuffer, destination.ToInt32()); + GL.BindBuffer(BufferTargetARB.CopyReadBuffer, source.ToInt32()); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, destination.ToInt32()); GL.CopyBufferSubData( - BufferTarget.CopyReadBuffer, - BufferTarget.CopyWriteBuffer, + BufferTargetARB.CopyReadBuffer, + BufferTargetARB.CopyWriteBuffer, (IntPtr)srcOffset, (IntPtr)dstOffset, (IntPtr)size); @@ -86,9 +86,9 @@ namespace Ryujinx.Graphics.OpenGL { IntPtr target = renderer.PersistentBuffers.Default.GetHostArray(size); - GL.BindBuffer(BufferTarget.CopyReadBuffer, buffer.ToInt32()); + GL.BindBuffer(BufferTargetARB.CopyReadBuffer, buffer.ToInt32()); - GL.GetBufferSubData(BufferTarget.CopyReadBuffer, (IntPtr)offset, size, target); + GL.GetBufferSubData(BufferTargetARB.CopyReadBuffer, (IntPtr)offset, size, target); return new PinnedSpan(target.ToPointer(), size); } @@ -96,19 +96,19 @@ namespace Ryujinx.Graphics.OpenGL public static void Resize(BufferHandle handle, int size) { - GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle.ToInt32()); - GL.BufferData(BufferTarget.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageHint.StreamCopy); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToInt32()); + GL.BufferData(BufferTargetARB.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageARB.StreamCopy); } public static void SetData(BufferHandle buffer, int offset, ReadOnlySpan data) { - GL.BindBuffer(BufferTarget.CopyWriteBuffer, buffer.ToInt32()); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, buffer.ToInt32()); unsafe { fixed (byte* ptr = data) { - GL.BufferSubData(BufferTarget.CopyWriteBuffer, (IntPtr)offset, data.Length, (IntPtr)ptr); + GL.BufferSubData(BufferTargetARB.CopyWriteBuffer, (IntPtr)offset, data.Length, (IntPtr)ptr); } } } diff --git a/src/Ryujinx.Graphics.OpenGL/Debugger.cs b/src/Ryujinx.Graphics.OpenGL/Debugger.cs index 7606bdbfd..498928743 100644 --- a/src/Ryujinx.Graphics.OpenGL/Debugger.cs +++ b/src/Ryujinx.Graphics.OpenGL/Debugger.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using System; @@ -16,7 +16,7 @@ namespace Ryujinx.Graphics.OpenGL public static void Initialize(GraphicsDebugLevel logLevel) { // Disable everything - GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DontCare, DebugSeverityControl.DontCare, 0, (int[])null, false); + GL.DebugMessageControl(DebugSource.DontCare, DebugType.DontCare, DebugSeverity.DontCare, 0, (int[])null, false); if (logLevel == GraphicsDebugLevel.None) { @@ -30,16 +30,16 @@ namespace Ryujinx.Graphics.OpenGL if (logLevel == GraphicsDebugLevel.Error) { - GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DebugTypeError, DebugSeverityControl.DontCare, 0, (int[])null, true); + GL.DebugMessageControl(DebugSource.DontCare, DebugType.DebugTypeError, DebugSeverity.DontCare, 0, (int[])null, true); } else if (logLevel == GraphicsDebugLevel.Slowdowns) { - GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DebugTypeError, DebugSeverityControl.DontCare, 0, (int[])null, true); - GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DebugTypePerformance, DebugSeverityControl.DontCare, 0, (int[])null, true); + GL.DebugMessageControl(DebugSource.DontCare, DebugType.DebugTypeError, DebugSeverity.DontCare, 0, (int[])null, true); + GL.DebugMessageControl(DebugSource.DontCare, DebugType.DebugTypePerformance, DebugSeverity.DontCare, 0, (int[])null, true); } else { - GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DontCare, DebugSeverityControl.DontCare, 0, (int[])null, true); + GL.DebugMessageControl(DebugSource.DontCare, DebugType.DontCare, DebugSeverity.DontCare, 0, (int[])null, true); } _counter = 0; @@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.OpenGL { int counter = Interlocked.Increment(ref _counter); - GL.PushDebugGroup(DebugSourceExternal.DebugSourceApplication, counter, dbgMsg.Length, dbgMsg); + GL.PushDebugGroup(DebugSource.DebugSourceApplication, counter, dbgMsg.Length, dbgMsg); } public static void PopGroup() @@ -103,7 +103,7 @@ namespace Ryujinx.Graphics.OpenGL public static void Print(string dbgMsg, DebugType type = DebugType.DebugTypeMarker, DebugSeverity severity = DebugSeverity.DebugSeverityNotification, int id = 999999) { - GL.DebugMessageInsert(DebugSourceExternal.DebugSourceApplication, type, id, severity, dbgMsg.Length, dbgMsg); + GL.DebugMessageInsert(DebugSource.DebugSourceApplication, type, id, severity, dbgMsg.Length, dbgMsg); } } } diff --git a/src/Ryujinx.Graphics.OpenGL/DrawTextureEmulation.cs b/src/Ryujinx.Graphics.OpenGL/DrawTextureEmulation.cs index 7a6af95ea..7b33ceda0 100644 --- a/src/Ryujinx.Graphics.OpenGL/DrawTextureEmulation.cs +++ b/src/Ryujinx.Graphics.OpenGL/DrawTextureEmulation.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.OpenGL.Image; using System; diff --git a/src/Ryujinx.Graphics.OpenGL/Effects/FsrScalingFilter.cs b/src/Ryujinx.Graphics.OpenGL/Effects/FsrScalingFilter.cs index 1a130bebb..20ab0cf44 100644 --- a/src/Ryujinx.Graphics.OpenGL/Effects/FsrScalingFilter.cs +++ b/src/Ryujinx.Graphics.OpenGL/Effects/FsrScalingFilter.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.OpenGL.Image; @@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects GL.ActiveTexture(TextureUnit.Texture0); int previousTextureBinding = GL.GetInteger(GetPName.TextureBinding2D); - GL.BindImageTexture(0, textureView.Handle, 0, false, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8); + GL.BindImageTexture(0, textureView.Handle, 0, false, 0, BufferAccessARB.ReadWrite, SizedInternalFormat.Rgba8); int threadGroupWorkRegionDim = 16; int dispatchX = (width + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; @@ -152,11 +152,11 @@ namespace Ryujinx.Graphics.OpenGL.Effects GL.Uniform1(_scaleYUniform, scaleY); GL.DispatchCompute(dispatchX, dispatchY, 1); - GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); + GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit); // Sharpening Pass GL.UseProgram(_sharpeningShaderProgram); - GL.BindImageTexture(0, destinationTexture.Handle, 0, false, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8); + GL.BindImageTexture(0, destinationTexture.Handle, 0, false, 0, BufferAccessARB.ReadWrite, SizedInternalFormat.Rgba8); textureView.Bind(0); GL.Uniform1(_inputUniform, 0); GL.Uniform1(_outputUniform, 0); @@ -164,7 +164,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects GL.DispatchCompute(dispatchX, dispatchY, 1); GL.UseProgram(previousProgram); - GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); + GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit); (_renderer.Pipeline as Pipeline).RestoreImages1And2(); diff --git a/src/Ryujinx.Graphics.OpenGL/Effects/FxaaPostProcessingEffect.cs b/src/Ryujinx.Graphics.OpenGL/Effects/FxaaPostProcessingEffect.cs index 4e92efe6d..53f96c806 100644 --- a/src/Ryujinx.Graphics.OpenGL/Effects/FxaaPostProcessingEffect.cs +++ b/src/Ryujinx.Graphics.OpenGL/Effects/FxaaPostProcessingEffect.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common; using Ryujinx.Graphics.OpenGL.Image; diff --git a/src/Ryujinx.Graphics.OpenGL/Effects/ShaderHelper.cs b/src/Ryujinx.Graphics.OpenGL/Effects/ShaderHelper.cs index c25fe5b25..dea858f34 100644 --- a/src/Ryujinx.Graphics.OpenGL/Effects/ShaderHelper.cs +++ b/src/Ryujinx.Graphics.OpenGL/Effects/ShaderHelper.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; namespace Ryujinx.Graphics.OpenGL.Effects { diff --git a/src/Ryujinx.Graphics.OpenGL/Effects/SmaaPostProcessingEffect.cs b/src/Ryujinx.Graphics.OpenGL/Effects/SmaaPostProcessingEffect.cs index a6c5e4aca..2834106bf 100644 --- a/src/Ryujinx.Graphics.OpenGL/Effects/SmaaPostProcessingEffect.cs +++ b/src/Ryujinx.Graphics.OpenGL/Effects/SmaaPostProcessingEffect.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.OpenGL.Image; @@ -210,16 +210,16 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa var dispatchY = BitUtils.DivRoundUp(view.Height, IPostProcessingEffect.LocalGroupSize); int previousProgram = GL.GetInteger(GetPName.CurrentProgram); - GL.BindImageTexture(0, edgeOutput.Handle, 0, false, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8); + GL.BindImageTexture(0, edgeOutput.Handle, 0, false, 0, BufferAccessARB.ReadWrite, SizedInternalFormat.Rgba8); GL.UseProgram(_edgeShaderPrograms[Quality]); view.Bind(0); GL.Uniform1(_inputUniform, 0); GL.Uniform1(_outputUniform, 0); GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height); GL.DispatchCompute(dispatchX, dispatchY, 1); - GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); + GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit); - GL.BindImageTexture(0, blendOutput.Handle, 0, false, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8); + GL.BindImageTexture(0, blendOutput.Handle, 0, false, 0, BufferAccessARB.ReadWrite, SizedInternalFormat.Rgba8); GL.UseProgram(_blendShaderPrograms[Quality]); edgeOutput.Bind(0); areaTexture.Bind(1); @@ -230,9 +230,9 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa GL.Uniform1(_samplerSearchUniform, 2); GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height); GL.DispatchCompute(dispatchX, dispatchY, 1); - GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); + GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit); - GL.BindImageTexture(0, textureView.Handle, 0, false, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8); + GL.BindImageTexture(0, textureView.Handle, 0, false, 0, BufferAccessARB.ReadWrite, SizedInternalFormat.Rgba8); GL.UseProgram(_neighbourShaderPrograms[Quality]); view.Bind(0); blendOutput.Bind(1); @@ -241,7 +241,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa GL.Uniform1(_samplerBlendUniform, 1); GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height); GL.DispatchCompute(dispatchX, dispatchY, 1); - GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); + GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit); (_renderer.Pipeline as Pipeline).RestoreImages1And2(); diff --git a/src/Ryujinx.Graphics.OpenGL/EnumConversion.cs b/src/Ryujinx.Graphics.OpenGL/EnumConversion.cs index a92c1ce89..6c02e4875 100644 --- a/src/Ryujinx.Graphics.OpenGL/EnumConversion.cs +++ b/src/Ryujinx.Graphics.OpenGL/EnumConversion.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Shader; @@ -12,7 +12,7 @@ namespace Ryujinx.Graphics.OpenGL switch (mode) { case AddressMode.Clamp: - return TextureWrapMode.Clamp; + return GLEnum.Clamp; case AddressMode.Repeat: return TextureWrapMode.Repeat; case AddressMode.MirrorClamp: @@ -154,94 +154,94 @@ namespace Ryujinx.Graphics.OpenGL return All.UncorrelatedNv; } - public static All Convert(this BlendFactor factor) + public static GLEnum Convert(this BlendFactor factor) { switch (factor) { case BlendFactor.Zero: case BlendFactor.ZeroGl: - return All.Zero; + return GLEnum.Zero; case BlendFactor.One: case BlendFactor.OneGl: - return All.One; + return GLEnum.One; case BlendFactor.SrcColor: case BlendFactor.SrcColorGl: - return All.SrcColor; + return GLEnum.SrcColor; case BlendFactor.OneMinusSrcColor: case BlendFactor.OneMinusSrcColorGl: - return All.OneMinusSrcColor; + return GLEnum.OneMinusSrcColor; case BlendFactor.SrcAlpha: case BlendFactor.SrcAlphaGl: - return All.SrcAlpha; + return GLEnum.SrcAlpha; case BlendFactor.OneMinusSrcAlpha: case BlendFactor.OneMinusSrcAlphaGl: - return All.OneMinusSrcAlpha; + return GLEnum.OneMinusSrcAlpha; case BlendFactor.DstAlpha: case BlendFactor.DstAlphaGl: - return All.DstAlpha; + return GLEnum.DstAlpha; case BlendFactor.OneMinusDstAlpha: case BlendFactor.OneMinusDstAlphaGl: - return All.OneMinusDstAlpha; + return GLEnum.OneMinusDstAlpha; case BlendFactor.DstColor: case BlendFactor.DstColorGl: - return All.DstColor; + return GLEnum.DstColor; case BlendFactor.OneMinusDstColor: case BlendFactor.OneMinusDstColorGl: - return All.OneMinusDstColor; + return GLEnum.OneMinusDstColor; case BlendFactor.SrcAlphaSaturate: case BlendFactor.SrcAlphaSaturateGl: - return All.SrcAlphaSaturate; + return GLEnum.SrcAlphaSaturate; case BlendFactor.Src1Color: case BlendFactor.Src1ColorGl: - return All.Src1Color; + return GLEnum.Src1Color; case BlendFactor.OneMinusSrc1Color: case BlendFactor.OneMinusSrc1ColorGl: - return All.OneMinusSrc1Color; + return GLEnum.OneMinusSrc1Color; case BlendFactor.Src1Alpha: case BlendFactor.Src1AlphaGl: - return All.Src1Alpha; + return GLEnum.Src1Alpha; case BlendFactor.OneMinusSrc1Alpha: case BlendFactor.OneMinusSrc1AlphaGl: - return All.OneMinusSrc1Alpha; + return GLEnum.OneMinusSrc1Alpha; case BlendFactor.ConstantColor: - return All.ConstantColor; + return GLEnum.ConstantColor; case BlendFactor.OneMinusConstantColor: - return All.OneMinusConstantColor; + return GLEnum.OneMinusConstantColor; case BlendFactor.ConstantAlpha: - return All.ConstantAlpha; + return GLEnum.ConstantAlpha; case BlendFactor.OneMinusConstantAlpha: - return All.OneMinusConstantAlpha; + return GLEnum.OneMinusConstantAlpha; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(BlendFactor)} enum value: {factor}."); - return All.Zero; + return GLEnum.Zero; } - public static BlendEquationMode Convert(this BlendOp op) + public static GLEnum Convert(this BlendOp op) { switch (op) { case BlendOp.Add: case BlendOp.AddGl: - return BlendEquationMode.FuncAdd; + return GLEnum.FuncAdd; case BlendOp.Minimum: case BlendOp.MinimumGl: - return BlendEquationMode.Min; + return GLEnum.Min; case BlendOp.Maximum: case BlendOp.MaximumGl: - return BlendEquationMode.Max; + return GLEnum.Max; case BlendOp.Subtract: case BlendOp.SubtractGl: - return BlendEquationMode.FuncSubtract; + return GLEnum.FuncSubtract; case BlendOp.ReverseSubtract: case BlendOp.ReverseSubtractGl: - return BlendEquationMode.FuncReverseSubtract; + return GLEnum.FuncReverseSubtract; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}."); - return BlendEquationMode.FuncAdd; + return GLEnum.FuncAdd; } public static TextureCompareMode Convert(this CompareMode mode) @@ -251,7 +251,7 @@ namespace Ryujinx.Graphics.OpenGL case CompareMode.None: return TextureCompareMode.None; case CompareMode.CompareRToTexture: - return TextureCompareMode.CompareRToTexture; + return TextureCompareMode.CompareRefToTexture; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}."); @@ -259,86 +259,86 @@ namespace Ryujinx.Graphics.OpenGL return TextureCompareMode.None; } - public static All Convert(this CompareOp op) + public static GLEnum Convert(this CompareOp op) { switch (op) { case CompareOp.Never: case CompareOp.NeverGl: - return All.Never; + return GLEnum.Never; case CompareOp.Less: case CompareOp.LessGl: - return All.Less; + return GLEnum.Less; case CompareOp.Equal: case CompareOp.EqualGl: - return All.Equal; + return GLEnum.Equal; case CompareOp.LessOrEqual: case CompareOp.LessOrEqualGl: - return All.Lequal; + return GLEnum.Lequal; case CompareOp.Greater: case CompareOp.GreaterGl: - return All.Greater; + return GLEnum.Greater; case CompareOp.NotEqual: case CompareOp.NotEqualGl: - return All.Notequal; + return GLEnum.Notequal; case CompareOp.GreaterOrEqual: case CompareOp.GreaterOrEqualGl: - return All.Gequal; + return GLEnum.Gequal; case CompareOp.Always: case CompareOp.AlwaysGl: - return All.Always; + return GLEnum.Always; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(CompareOp)} enum value: {op}."); - return All.Never; + return GLEnum.Never; } - public static ClipDepthMode Convert(this DepthMode mode) + public static GLEnum Convert(this DepthMode mode) { switch (mode) { case DepthMode.MinusOneToOne: - return ClipDepthMode.NegativeOneToOne; + return GLEnum.NegativeOneToOne; case DepthMode.ZeroToOne: - return ClipDepthMode.ZeroToOne; + return GLEnum.ZeroToOne; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(DepthMode)} enum value: {mode}."); - return ClipDepthMode.NegativeOneToOne; + return GLEnum.NegativeOneToOne; } - public static All Convert(this DepthStencilMode mode) + public static GLEnum Convert(this DepthStencilMode mode) { switch (mode) { case DepthStencilMode.Depth: - return All.DepthComponent; + return GLEnum.DepthComponent; case DepthStencilMode.Stencil: - return All.StencilIndex; + return GLEnum.StencilIndex; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}."); - return All.Depth; + return GLEnum.Depth; } - public static CullFaceMode Convert(this Face face) + public static GLEnum Convert(this Face face) { switch (face) { case Face.Back: - return CullFaceMode.Back; + return GLEnum.Back; case Face.Front: - return CullFaceMode.Front; + return GLEnum.Front; case Face.FrontAndBack: - return CullFaceMode.FrontAndBack; + return GLEnum.FrontAndBack; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}."); - return CullFaceMode.Back; + return GLEnum.Back; } public static FrontFaceDirection Convert(this FrontFace frontFace) @@ -346,14 +346,14 @@ namespace Ryujinx.Graphics.OpenGL switch (frontFace) { case FrontFace.Clockwise: - return FrontFaceDirection.Cw; + return FrontFaceDirection.CW; case FrontFace.CounterClockwise: return FrontFaceDirection.Ccw; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}."); - return FrontFaceDirection.Cw; + return FrontFaceDirection.CW; } public static DrawElementsType Convert(this IndexType type) @@ -411,21 +411,21 @@ namespace Ryujinx.Graphics.OpenGL return TextureMinFilter.Nearest; } - public static OpenTK.Graphics.OpenGL.PolygonMode Convert(this GAL.PolygonMode mode) + public static Silk.NET.OpenGL.PolygonMode Convert(this GAL.PolygonMode mode) { switch (mode) { case GAL.PolygonMode.Point: - return OpenTK.Graphics.OpenGL.PolygonMode.Point; + return Silk.NET.OpenGL.PolygonMode.Point; case GAL.PolygonMode.Line: - return OpenTK.Graphics.OpenGL.PolygonMode.Line; + return Silk.NET.OpenGL.PolygonMode.Line; case GAL.PolygonMode.Fill: - return OpenTK.Graphics.OpenGL.PolygonMode.Fill; + return Silk.NET.OpenGL.PolygonMode.Fill; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(GAL.PolygonMode)} enum value: {mode}."); - return OpenTK.Graphics.OpenGL.PolygonMode.Fill; + return Silk.NET.OpenGL.PolygonMode.Fill; } public static PrimitiveType Convert(this PrimitiveTopology topology) @@ -615,47 +615,47 @@ namespace Ryujinx.Graphics.OpenGL return NvViewportSwizzle.ViewportSwizzlePositiveXNv; } - public static All Convert(this LogicalOp op) + public static GLEnum Convert(this LogicalOp op) { switch (op) { case LogicalOp.Clear: - return All.Clear; + return GLEnum.Clear; case LogicalOp.And: - return All.And; + return GLEnum.And; case LogicalOp.AndReverse: - return All.AndReverse; + return GLEnum.AndReverse; case LogicalOp.Copy: - return All.Copy; + return GLEnum.Copy; case LogicalOp.AndInverted: - return All.AndInverted; + return GLEnum.AndInverted; case LogicalOp.Noop: - return All.Noop; + return GLEnum.Noop; case LogicalOp.Xor: - return All.Xor; + return GLEnum.Xor; case LogicalOp.Or: - return All.Or; + return GLEnum.Or; case LogicalOp.Nor: - return All.Nor; + return GLEnum.Nor; case LogicalOp.Equiv: - return All.Equiv; + return GLEnum.Equiv; case LogicalOp.Invert: - return All.Invert; + return GLEnum.Invert; case LogicalOp.OrReverse: - return All.OrReverse; + return GLEnum.OrReverse; case LogicalOp.CopyInverted: - return All.CopyInverted; + return GLEnum.CopyInverted; case LogicalOp.OrInverted: - return All.OrInverted; + return GLEnum.OrInverted; case LogicalOp.Nand: - return All.Nand; + return GLEnum.Nand; case LogicalOp.Set: - return All.Set; + return GLEnum.Set; } Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(LogicalOp)} enum value: {op}."); - return All.Never; + return GLEnum.Never; } public static ShaderType Convert(this ShaderStage stage) diff --git a/src/Ryujinx.Graphics.OpenGL/Framebuffer.cs b/src/Ryujinx.Graphics.OpenGL/Framebuffer.cs index 394b8bc76..1c1334d3a 100644 --- a/src/Ryujinx.Graphics.OpenGL/Framebuffer.cs +++ b/src/Ryujinx.Graphics.OpenGL/Framebuffer.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.OpenGL.Image; using System; @@ -107,11 +107,11 @@ namespace Ryujinx.Graphics.OpenGL private static void SetDrawBuffersImpl(int colorsCount) { - DrawBuffersEnum[] drawBuffers = new DrawBuffersEnum[colorsCount]; + DrawBufferMode[] drawBuffers = new DrawBufferMode[colorsCount]; for (int index = 0; index < colorsCount; index++) { - drawBuffers[index] = DrawBuffersEnum.ColorAttachment0 + index; + drawBuffers[index] = DrawBufferMode.ColorAttachment0 + index; } GL.DrawBuffers(colorsCount, drawBuffers); diff --git a/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs b/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs index cf0b0645c..a7a47b075 100644 --- a/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs +++ b/src/Ryujinx.Graphics.OpenGL/HwCapabilities.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using System; namespace Ryujinx.Graphics.OpenGL @@ -27,9 +27,9 @@ namespace Ryujinx.Graphics.OpenGL private static readonly Lazy _supportsTextureShadowLod = new(() => HasExtension("GL_EXT_texture_shadow_lod")); private static readonly Lazy _supportsViewportSwizzle = new(() => HasExtension("GL_NV_viewport_swizzle")); - private static readonly Lazy _maximumComputeSharedMemorySize = new(() => GetLimit(All.MaxComputeSharedMemorySize)); - private static readonly Lazy _storageBufferOffsetAlignment = new(() => GetLimit(All.ShaderStorageBufferOffsetAlignment)); - private static readonly Lazy _textureBufferOffsetAlignment = new(() => GetLimit(All.TextureBufferOffsetAlignment)); + private static readonly Lazy _maximumComputeSharedMemorySize = new(() => GetLimit(GLEnum.MaxComputeSharedMemorySize)); + private static readonly Lazy _storageBufferOffsetAlignment = new(() => GetLimit(GLEnum.ShaderStorageBufferOffsetAlignment)); + private static readonly Lazy _textureBufferOffsetAlignment = new(() => GetLimit(GLEnum.TextureBufferOffsetAlignment)); public enum GpuVendor { @@ -47,7 +47,7 @@ namespace Ryujinx.Graphics.OpenGL public static GpuVendor Vendor => _gpuVendor.Value; - private static readonly Lazy _maxSupportedAnisotropy = new(GL.GetFloat((GetPName)All.MaxTextureMaxAnisotropy)); + private static readonly Lazy _maxSupportedAnisotropy = new(GL.GetFloat((GetPName)GLEnum.MaxTextureMaxAnisotropy)); public static bool UsePersistentBufferForFlush => _gpuVendor.Value == GpuVendor.AmdWindows || _gpuVendor.Value == GpuVendor.Nvidia; @@ -98,7 +98,7 @@ namespace Ryujinx.Graphics.OpenGL return false; } - private static int GetLimit(All name) + private static int GetLimit(GLEnum name) { return GL.GetInteger((GetPName)name); } diff --git a/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs b/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs index 1c5acedf3..6e1a0819b 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/ImageArray.cs @@ -1,6 +1,5 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; -using System; namespace Ryujinx.Graphics.OpenGL.Image { @@ -50,7 +49,7 @@ namespace Ryujinx.Graphics.OpenGL.Image { if (_images[i].Handle == 0) { - GL.BindImageTexture(baseBinding + i, 0, 0, true, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8); + GL.BindImageTexture(baseBinding + i, 0, 0, true, 0, BufferAccessARB.ReadWrite, SizedInternalFormat.Rgba8); } else { @@ -58,7 +57,7 @@ namespace Ryujinx.Graphics.OpenGL.Image if (format != 0) { - GL.BindImageTexture(baseBinding + i, _images[i].Handle, 0, true, 0, TextureAccess.ReadWrite, format); + GL.BindImageTexture(baseBinding + i, _images[i].Handle, 0, true, 0, BufferAccessARB.ReadWrite, format); } } } diff --git a/src/Ryujinx.Graphics.OpenGL/Image/Sampler.cs b/src/Ryujinx.Graphics.OpenGL/Image/Sampler.cs index 6cf048296..e06e6b22d 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/Sampler.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/Sampler.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; namespace Ryujinx.Graphics.OpenGL.Image @@ -11,20 +11,20 @@ namespace Ryujinx.Graphics.OpenGL.Image { Handle = GL.GenSampler(); - GL.SamplerParameter(Handle, SamplerParameterName.TextureMinFilter, (int)info.MinFilter.Convert()); - GL.SamplerParameter(Handle, SamplerParameterName.TextureMagFilter, (int)info.MagFilter.Convert()); + GL.SamplerParameter(Handle, SamplerParameterI.MinFilter, (int)info.MinFilter.Convert()); + GL.SamplerParameter(Handle, SamplerParameterI.MagFilter, (int)info.MagFilter.Convert()); if (HwCapabilities.SupportsSeamlessCubemapPerTexture) { GL.SamplerParameter(Handle, (SamplerParameterName)ArbSeamlessCubemapPerTexture.TextureCubeMapSeamless, info.SeamlessCubemap ? 1 : 0); } - GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapS, (int)info.AddressU.Convert()); - GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapT, (int)info.AddressV.Convert()); - GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapR, (int)info.AddressP.Convert()); + GL.SamplerParameter(Handle, SamplerParameterI.WrapS, (int)info.AddressU.Convert()); + GL.SamplerParameter(Handle, SamplerParameterI.WrapT, (int)info.AddressV.Convert()); + GL.SamplerParameter(Handle, SamplerParameterI.WrapR, (int)info.AddressP.Convert()); - GL.SamplerParameter(Handle, SamplerParameterName.TextureCompareMode, (int)info.CompareMode.Convert()); - GL.SamplerParameter(Handle, SamplerParameterName.TextureCompareFunc, (int)info.CompareOp.Convert()); + GL.SamplerParameter(Handle, SamplerParameterI.CompareMode, (int)info.CompareMode.Convert()); + GL.SamplerParameter(Handle, SamplerParameterI.CompareFunc, (int)info.CompareOp.Convert()); unsafe { @@ -36,14 +36,14 @@ namespace Ryujinx.Graphics.OpenGL.Image info.BorderColor.Alpha, }; - GL.SamplerParameter(Handle, SamplerParameterName.TextureBorderColor, borderColor); + GL.SamplerParameter(Handle, SamplerParameterF.BorderColor, borderColor); } - GL.SamplerParameter(Handle, SamplerParameterName.TextureMinLod, info.MinLod); - GL.SamplerParameter(Handle, SamplerParameterName.TextureMaxLod, info.MaxLod); - GL.SamplerParameter(Handle, SamplerParameterName.TextureLodBias, info.MipLodBias); + GL.SamplerParameter(Handle, SamplerParameterF.TextureMinLod, info.MinLod); + GL.SamplerParameter(Handle, SamplerParameterF.TextureMaxLod, info.MaxLod); + GL.SamplerParameter(Handle, SamplerParameterF.TextureLodBias, info.MipLodBias); - GL.SamplerParameter(Handle, SamplerParameterName.TextureMaxAnisotropyExt, info.MaxAnisotropy); + GL.SamplerParameter(Handle, SamplerParameterF.MaxAnisotropy, info.MaxAnisotropy); } public void Bind(int unit) diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs index df8453830..084d8003a 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; namespace Ryujinx.Graphics.OpenGL.Image diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs index a8196541a..755364c33 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using System; using System.Buffers; @@ -95,9 +95,9 @@ namespace Ryujinx.Graphics.OpenGL.Image Bind(0); - SizedInternalFormat format = (SizedInternalFormat)FormatTable.GetFormatInfo(Info.Format).PixelInternalFormat; + SizedInternalFormat format = (SizedInternalFormat)FormatTable.GetFormatInfo(Info.Format).InternalFormat; - GL.TexBufferRange(TextureBufferTarget.TextureBuffer, format, _buffer.ToInt32(), (IntPtr)buffer.Offset, buffer.Size); + GL.TexBufferRange(TextureTarget.TextureBuffer, format, _buffer.ToInt32(), (IntPtr)buffer.Offset, buffer.Size); } public void Dispose() diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs index 89bd5e4ff..2b3fd891f 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common; using Ryujinx.Graphics.GAL; using System; @@ -348,16 +348,16 @@ namespace Ryujinx.Graphics.OpenGL.Image EnsurePbo(from); - GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyPboHandle); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyPboHandle); from.WriteToPbo(0, forceBgra: true); - GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, _copyPboHandle); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0); + GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, _copyPboHandle); to.ReadFromPbo(0, _copyPboSize); - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0); + GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, 0); return to; } @@ -393,7 +393,7 @@ namespace Ryujinx.Graphics.OpenGL.Image EnsurePbo(from); - GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyPboHandle); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyPboHandle); // The source texture is written out in full, then the destination is taken as a slice from the data using unpack params. // The offset points to the base at which the requested layer is at. @@ -412,15 +412,15 @@ namespace Ryujinx.Graphics.OpenGL.Image if (to.Info.IsCompressed) { - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockWidth, to.Info.BlockWidth); - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockHeight, to.Info.BlockHeight); - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockDepth, 1); - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockSize, to.Info.BytesPerPixel); + GL.PixelStore(GLEnum.UnpackCompressedBlockWidth, to.Info.BlockWidth); + GL.PixelStore(GLEnum.UnpackCompressedBlockHeight, to.Info.BlockHeight); + GL.PixelStore(GLEnum.UnpackCompressedBlockDepth, 1); + GL.PixelStore(GLEnum.UnpackCompressedBlockSize, to.Info.BytesPerPixel); } } - GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, _copyPboHandle); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0); + GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, _copyPboHandle); to.ReadFromPbo2D(offset, dstLayer, dstLevel, dstWidth, dstHeight); @@ -432,14 +432,14 @@ namespace Ryujinx.Graphics.OpenGL.Image if (to.Info.IsCompressed) { - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockWidth, 0); - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockHeight, 0); - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockDepth, 0); - GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockSize, 0); + GL.PixelStore(GLEnum.UnpackCompressedBlockWidth, 0); + GL.PixelStore(GLEnum.UnpackCompressedBlockHeight, 0); + GL.PixelStore(GLEnum.UnpackCompressedBlockDepth, 0); + GL.PixelStore(GLEnum.UnpackCompressedBlockSize, 0); } } - GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0); + GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, 0); } private void EnsurePbo(TextureView view) @@ -463,8 +463,8 @@ namespace Ryujinx.Graphics.OpenGL.Image _copyPboHandle = GL.GenBuffer(); _copyPboSize = requiredSize; - GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyPboHandle); - GL.BufferData(BufferTarget.PixelPackBuffer, requiredSize, IntPtr.Zero, BufferUsageHint.DynamicCopy); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyPboHandle); + GL.BufferData(BufferTargetARB.PixelPackBuffer, requiredSize, IntPtr.Zero, BufferUsageARB.DynamicCopy); } } diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyIncompatible.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyIncompatible.cs index 082e6ccf8..af6f7b32f 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyIncompatible.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyIncompatible.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using System; using System.Collections.Generic; using System.Globalization; @@ -111,8 +111,8 @@ void main() for (int z = 0; z < depth; z++) { - GL.BindImageTexture(0, src.Handle, srcLevel + l, false, srcLayer + z, TextureAccess.ReadOnly, srcFormat); - GL.BindImageTexture(1, dst.Handle, dstLevel + l, false, dstLayer + z, TextureAccess.WriteOnly, dstFormat); + GL.BindImageTexture(0, src.Handle, srcLevel + l, false, srcLayer + z, BufferAccessARB.ReadOnly, srcFormat); + GL.BindImageTexture(1, dst.Handle, dstLevel + l, false, dstLayer + z, BufferAccessARB.WriteOnly, dstFormat); GL.DispatchCompute((width + 31) / 32, (height + 31) / 32, 1); } @@ -131,7 +131,7 @@ void main() return componentsCount switch { 1 => SizedInternalFormat.R8ui, - 2 => SizedInternalFormat.Rg8ui, + 2 => SizedInternalFormat.RG8ui, 4 => SizedInternalFormat.Rgba8ui, _ => throw new ArgumentException($"Invalid components count {componentsCount}."), }; @@ -141,7 +141,7 @@ void main() return componentsCount switch { 1 => SizedInternalFormat.R16ui, - 2 => SizedInternalFormat.Rg16ui, + 2 => SizedInternalFormat.RG16ui, 4 => SizedInternalFormat.Rgba16ui, _ => throw new ArgumentException($"Invalid components count {componentsCount}."), }; @@ -151,7 +151,7 @@ void main() return componentsCount switch { 1 => SizedInternalFormat.R32ui, - 2 => SizedInternalFormat.Rg32ui, + 2 => SizedInternalFormat.RG32ui, 4 => SizedInternalFormat.Rgba32ui, _ => throw new ArgumentException($"Invalid components count {componentsCount}."), }; diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyMS.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyMS.cs index 0fa6453dc..ba86985c4 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyMS.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopyMS.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using System; using System.Numerics; @@ -119,8 +119,8 @@ void main() for (int z = 0; z < depth; z++) { - GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, TextureAccess.ReadOnly, GetFormat(srcInfo.BytesPerPixel)); - GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, TextureAccess.WriteOnly, GetFormat(dstInfo.BytesPerPixel)); + GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, BufferAccessARB.ReadOnly, GetFormat(srcInfo.BytesPerPixel)); + GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, BufferAccessARB.WriteOnly, GetFormat(dstInfo.BytesPerPixel)); GL.DispatchCompute((dstWidth + 31) / 32, (dstHeight + 31) / 32, 1); } @@ -149,8 +149,8 @@ void main() for (int z = 0; z < depth; z++) { - GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, TextureAccess.ReadOnly, GetFormat(srcInfo.BytesPerPixel)); - GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, TextureAccess.WriteOnly, GetFormat(dstInfo.BytesPerPixel)); + GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, BufferAccessARB.ReadOnly, GetFormat(srcInfo.BytesPerPixel)); + GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, BufferAccessARB.WriteOnly, GetFormat(dstInfo.BytesPerPixel)); GL.DispatchCompute((srcWidth + 31) / 32, (srcHeight + 31) / 32, 1); } @@ -171,7 +171,7 @@ void main() 1 => SizedInternalFormat.R8ui, 2 => SizedInternalFormat.R16ui, 4 => SizedInternalFormat.R32ui, - 8 => SizedInternalFormat.Rg32ui, + 8 => SizedInternalFormat.RG32ui, 16 => SizedInternalFormat.Rgba32ui, _ => throw new ArgumentException($"Invalid bytes per pixel {bytesPerPixel}."), }; @@ -189,7 +189,7 @@ void main() handle, texture.Info.Target.Convert(), texture.Storage.Handle, - PixelInternalFormat.Rgba8, + InternalFormat.Rgba8, texture.FirstLevel, 1, texture.FirstLayer, diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureStorage.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureStorage.cs index 79c6cb685..dc31143ac 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureStorage.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureStorage.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; @@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.OpenGL.Image } else { - internalFormat = (SizedInternalFormat)format.PixelInternalFormat; + internalFormat = (SizedInternalFormat)format.InternalFormat; } int levels = Info.GetLevelsClamped(); @@ -54,7 +54,7 @@ namespace Ryujinx.Graphics.OpenGL.Image { case Target.Texture1D: GL.TexStorage1D( - TextureTarget1d.Texture1D, + TextureTarget.Texture1D, levels, internalFormat, Info.Width); @@ -62,7 +62,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.Texture1DArray: GL.TexStorage2D( - TextureTarget2d.Texture1DArray, + TextureTarget.Texture1DArray, levels, internalFormat, Info.Width, @@ -71,7 +71,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.Texture2D: GL.TexStorage2D( - TextureTarget2d.Texture2D, + TextureTarget.Texture2D, levels, internalFormat, Info.Width, @@ -80,7 +80,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.Texture2DArray: GL.TexStorage3D( - TextureTarget3d.Texture2DArray, + TextureTarget.Texture2DArray, levels, internalFormat, Info.Width, @@ -90,7 +90,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.Texture2DMultisample: GL.TexStorage2DMultisample( - TextureTargetMultisample2d.Texture2DMultisample, + TextureTarget.Texture2DMultisample, Info.Samples, internalFormat, Info.Width, @@ -100,7 +100,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.Texture2DMultisampleArray: GL.TexStorage3DMultisample( - TextureTargetMultisample3d.Texture2DMultisampleArray, + TextureTarget.Texture2DMultisampleArray, Info.Samples, internalFormat, Info.Width, @@ -111,7 +111,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.Texture3D: GL.TexStorage3D( - TextureTarget3d.Texture3D, + TextureTarget.Texture3D, levels, internalFormat, Info.Width, @@ -121,7 +121,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.Cubemap: GL.TexStorage2D( - TextureTarget2d.TextureCubeMap, + TextureTarget.TextureCubeMap, levels, internalFormat, Info.Width, @@ -130,7 +130,7 @@ namespace Ryujinx.Graphics.OpenGL.Image case Target.CubemapArray: GL.TexStorage3D( - (TextureTarget3d)All.TextureCubeMapArray, + TextureTarget.TextureCubeMapArray, levels, internalFormat, Info.Width, diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs index 8a18e6132..3d65c8a29 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common; using Ryujinx.Graphics.GAL; using System; @@ -40,15 +40,15 @@ namespace Ryujinx.Graphics.OpenGL.Image FormatInfo format = FormatTable.GetFormatInfo(Info.Format); - PixelInternalFormat pixelInternalFormat; + InternalFormat pixelInternalFormat; if (format.IsCompressed) { - pixelInternalFormat = (PixelInternalFormat)format.PixelFormat; + pixelInternalFormat = (InternalFormat)format.PixelFormat; } else { - pixelInternalFormat = format.PixelInternalFormat; + pixelInternalFormat = format.InternalFormat; } int levels = Info.GetLevelsClamped(); @@ -322,7 +322,7 @@ namespace Ryujinx.Graphics.OpenGL.Image throw new NotSupportedException("Stride conversion for texture copy to buffer not supported."); } - GL.BindBuffer(BufferTarget.PixelPackBuffer, range.Handle.ToInt32()); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, range.Handle.ToInt32()); FormatInfo format = FormatTable.GetFormatInfo(Info.Format); if (format.PixelFormat == PixelFormat.DepthStencil) @@ -334,7 +334,7 @@ namespace Ryujinx.Graphics.OpenGL.Image Debug.Assert(offset == 0); - GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0); } public void WriteToPbo(int offset, bool forceBgra) @@ -405,9 +405,9 @@ namespace Ryujinx.Graphics.OpenGL.Image { if (pixelType == PixelType.UnsignedShort565) { - pixelType = PixelType.UnsignedShort565Reversed; + pixelType = PixelType.UnsignedShort565Rev; } - else if (pixelType == PixelType.UnsignedShort565Reversed) + else if (pixelType == PixelType.UnsignedShort565Rev) { pixelType = PixelType.UnsignedShort565; } diff --git a/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs b/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs index d56c40af4..0d3a7e218 100644 --- a/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs +++ b/src/Ryujinx.Graphics.OpenGL/OpenGLRenderer.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; @@ -238,7 +238,7 @@ namespace Ryujinx.Graphics.OpenGL // This call is expected to fail if we're running with a core profile, // as this clamp target was deprecated, but that's fine as a core profile // should already have the desired behaviour were outputs are not clamped. - GL.ClampColor(ClampColorTarget.ClampFragmentColor, ClampColorMode.False); + GL.ClampColor(ClampColorTargetARB.FragmentColorArb, ClampColorModeARB.False); } private void PrintGpuInformation() diff --git a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs index ebfe3ad64..e809e966f 100644 --- a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs +++ b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.OpenGL.Image; @@ -26,8 +26,8 @@ namespace Ryujinx.Graphics.OpenGL public void Map(BufferHandle handle, int size) { - GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle.ToInt32()); - IntPtr ptr = GL.MapBufferRange(BufferTarget.CopyWriteBuffer, IntPtr.Zero, size, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToInt32()); + IntPtr ptr = GL.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, size, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit); _maps[handle] = ptr; } @@ -36,8 +36,8 @@ namespace Ryujinx.Graphics.OpenGL { if (_maps.ContainsKey(handle)) { - GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle.ToInt32()); - GL.UnmapBuffer(BufferTarget.CopyWriteBuffer); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToInt32()); + GL.UnmapBuffer(BufferTargetARB.CopyWriteBuffer); _maps.Remove(handle); } @@ -72,10 +72,10 @@ namespace Ryujinx.Graphics.OpenGL _copyBufferHandle = GL.GenBuffer(); _copyBufferSize = requiredSize; - GL.BindBuffer(BufferTarget.CopyWriteBuffer, _copyBufferHandle); - GL.BufferStorage(BufferTarget.CopyWriteBuffer, requiredSize, IntPtr.Zero, BufferStorageFlags.MapReadBit | BufferStorageFlags.MapPersistentBit); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, _copyBufferHandle); + GL.BufferStorage(BufferTargetARB.CopyWriteBuffer, requiredSize, IntPtr.Zero, BufferStorageFlags.MapReadBit | BufferStorageFlags.MapPersistentBit); - _bufferMap = GL.MapBufferRange(BufferTarget.CopyWriteBuffer, IntPtr.Zero, requiredSize, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit); + _bufferMap = GL.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, requiredSize, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit); } } @@ -110,11 +110,11 @@ namespace Ryujinx.Graphics.OpenGL { EnsureBuffer(size); - GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyBufferHandle); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyBufferHandle); view.WriteToPbo(0, false); - GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0); Sync(); @@ -125,11 +125,11 @@ namespace Ryujinx.Graphics.OpenGL { EnsureBuffer(size); - GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyBufferHandle); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyBufferHandle); int offset = view.WriteToPbo2D(0, layer, level); - GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); + GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0); Sync(); @@ -140,12 +140,12 @@ namespace Ryujinx.Graphics.OpenGL { EnsureBuffer(size); - GL.BindBuffer(BufferTarget.CopyReadBuffer, buffer.ToInt32()); - GL.BindBuffer(BufferTarget.CopyWriteBuffer, _copyBufferHandle); + GL.BindBuffer(BufferTargetARB.CopyReadBuffer, buffer.ToInt32()); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, _copyBufferHandle); - GL.CopyBufferSubData(BufferTarget.CopyReadBuffer, BufferTarget.CopyWriteBuffer, (IntPtr)offset, IntPtr.Zero, size); + GL.CopyBufferSubData(BufferTargetARB.CopyReadBuffer, BufferTargetARB.CopyWriteBuffer, (IntPtr)offset, IntPtr.Zero, size); - GL.BindBuffer(BufferTarget.CopyWriteBuffer, 0); + GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, 0); Sync(); diff --git a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs index 6d066bb67..862478220 100644 --- a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.OpenGL.Image; @@ -119,14 +119,14 @@ namespace Ryujinx.Graphics.OpenGL { _framebuffer.AttachColorLayerForClear(index, l); - GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Color, index, colors); + GL.ClearBuffer(BufferKind.Color, index, colors); } _framebuffer.DetachColorLayerForClear(index); } else { - GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Color, index, colors); + GL.ClearBuffer(BufferKind.Color, index, colors); } RestoreComponentMask(index); @@ -187,11 +187,11 @@ namespace Ryujinx.Graphics.OpenGL } else if (depthMask) { - GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Depth, 0, ref depthValue); + GL.ClearBuffer(BufferKind.Depth, 0, ref depthValue); } else if (stencilMask != 0) { - GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Stencil, 0, ref stencilValue); + GL.ClearBuffer(BufferKind.Stencil, 0, ref stencilValue); } } @@ -634,7 +634,7 @@ namespace Ryujinx.Graphics.OpenGL PreDrawVbUnbounded(); - GL.BindBuffer((BufferTarget)All.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32()); + GL.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32()); GL.DrawArraysIndirect(_primitiveType, (IntPtr)indirectBuffer.Offset); @@ -651,8 +651,8 @@ namespace Ryujinx.Graphics.OpenGL PreDrawVbUnbounded(); - GL.BindBuffer((BufferTarget)All.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32()); - GL.BindBuffer((BufferTarget)All.ParameterBuffer, parameterBuffer.Handle.ToInt32()); + GL.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32()); + GL.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToInt32()); GL.MultiDrawArraysIndirectCount( _primitiveType, diff --git a/src/Ryujinx.Graphics.OpenGL/Program.cs b/src/Ryujinx.Graphics.OpenGL/Program.cs index 19de06f8f..a593e79df 100644 --- a/src/Ryujinx.Graphics.OpenGL/Program.cs +++ b/src/Ryujinx.Graphics.OpenGL/Program.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Shader; diff --git a/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs b/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs index 0a85970d7..05e18659d 100644 --- a/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs +++ b/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Logging; using System; using System.Runtime.InteropServices; @@ -24,14 +24,14 @@ namespace Ryujinx.Graphics.OpenGL.Queries Query = GL.GenQuery(); _type = type; - GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); + GL.BindBuffer(BufferTargetARB.QueryBuffer, _buffer); unsafe { long defaultValue = DefaultValue; - GL.BufferStorage(BufferTarget.QueryBuffer, sizeof(long), (IntPtr)(&defaultValue), BufferStorageFlags.MapReadBit | BufferStorageFlags.MapWriteBit | BufferStorageFlags.MapPersistentBit); + GL.BufferStorage(BufferTargetARB.QueryBuffer, sizeof(long), (IntPtr)(&defaultValue), BufferStorageMask.MapReadBit | BufferStorageMask.MapWriteBit | BufferStorageMask.MapPersistentBit); } - _bufferMap = GL.MapBufferRange(BufferTarget.QueryBuffer, IntPtr.Zero, sizeof(long), BufferAccessMask.MapReadBit | BufferAccessMask.MapWriteBit | BufferAccessMask.MapPersistentBit); + _bufferMap = GL.MapBufferRange(BufferTargetARB.QueryBuffer, IntPtr.Zero, sizeof(long), MapBufferAccessMask.ReadBit | MapBufferAccessMask.WriteBit | MapBufferAccessMask.PersistentBit); } public void Reset() @@ -51,11 +51,11 @@ namespace Ryujinx.Graphics.OpenGL.Queries if (withResult) { - GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); + GL.BindBuffer(BufferTargetARB.QueryBuffer, _buffer); Marshal.WriteInt64(_bufferMap, -1L); GL.GetQueryObject(Query, GetQueryObjectParam.QueryResult, (long*)0); - GL.MemoryBarrier(MemoryBarrierFlags.QueryBufferBarrierBit | MemoryBarrierFlags.ClientMappedBufferBarrierBit); + GL.MemoryBarrier(MemoryBarrierMask.QueryBufferBarrierBit | MemoryBarrierMask.ClientMappedBufferBarrierBit); } else { @@ -111,8 +111,8 @@ namespace Ryujinx.Graphics.OpenGL.Queries public void Dispose() { - GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); - GL.UnmapBuffer(BufferTarget.QueryBuffer); + GL.BindBuffer(BufferTargetARB.QueryBuffer, _buffer); + GL.UnmapBuffer(BufferTargetARB.QueryBuffer); GL.DeleteBuffer(_buffer); GL.DeleteQuery(Query); } diff --git a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs index 345a99ffa..0a2f35036 100644 --- a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs +++ b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using System; using System.Collections.Generic; diff --git a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs index 32b75c615..d37aeae4f 100644 --- a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs +++ b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using System; using System.Threading; @@ -62,7 +62,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries return true; } - if (ClearCounter || Type == QueryTarget.Timestamp) + if (ClearCounter || Type == QueryTarget.TimeElapsed) { result = 0; } diff --git a/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj b/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj index 3d64da99b..0c85af38c 100644 --- a/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj +++ b/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj @@ -6,7 +6,8 @@ - + + diff --git a/src/Ryujinx.Graphics.OpenGL/Sync.cs b/src/Ryujinx.Graphics.OpenGL/Sync.cs index eba1638a3..469937889 100644 --- a/src/Ryujinx.Graphics.OpenGL/Sync.cs +++ b/src/Ryujinx.Graphics.OpenGL/Sync.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Logging; using System; using System.Collections.Generic; diff --git a/src/Ryujinx.Graphics.OpenGL/VertexArray.cs b/src/Ryujinx.Graphics.OpenGL/VertexArray.cs index 32211e783..6cde939eb 100644 --- a/src/Ryujinx.Graphics.OpenGL/VertexArray.cs +++ b/src/Ryujinx.Graphics.OpenGL/VertexArray.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using System; using System.Numerics; @@ -134,19 +134,19 @@ namespace Ryujinx.Graphics.OpenGL public void SetIndexBuffer(BufferRange range) { _indexBuffer = range; - GL.BindBuffer(BufferTarget.ElementArrayBuffer, range.Handle.ToInt32()); + GL.BindBuffer(BufferTargetARB.ElementArrayBuffer, range.Handle.ToInt32()); } public void SetRangeOfIndexBuffer() { Buffer.Resize(_tempIndexBuffer, _indexBuffer.Size); Buffer.Copy(_indexBuffer.Handle, _tempIndexBuffer, _indexBuffer.Offset, 0, _indexBuffer.Size); - GL.BindBuffer(BufferTarget.ElementArrayBuffer, _tempIndexBuffer.ToInt32()); + GL.BindBuffer(BufferTargetARB.ElementArrayBuffer, _tempIndexBuffer.ToInt32()); } public void RestoreIndexBuffer() { - GL.BindBuffer(BufferTarget.ElementArrayBuffer, _indexBuffer.Handle.ToInt32()); + GL.BindBuffer(BufferTargetARB.ElementArrayBuffer, _indexBuffer.Handle.ToInt32()); } public void PreDraw(int vertexCount) diff --git a/src/Ryujinx.Graphics.OpenGL/Window.cs b/src/Ryujinx.Graphics.OpenGL/Window.cs index 6bcfefa4e..69bbe7034 100644 --- a/src/Ryujinx.Graphics.OpenGL/Window.cs +++ b/src/Ryujinx.Graphics.OpenGL/Window.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.OpenGL.Effects; using Ryujinx.Graphics.OpenGL.Effects.Smaa; diff --git a/src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj b/src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj index 68bf98981..7679c8230 100644 --- a/src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj +++ b/src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj @@ -27,7 +27,6 @@ - diff --git a/src/Ryujinx.Gtk3/UI/OpenGLRenderer.cs b/src/Ryujinx.Gtk3/UI/OpenGLRenderer.cs index 1fdabc754..6133c8be0 100644 --- a/src/Ryujinx.Gtk3/UI/OpenGLRenderer.cs +++ b/src/Ryujinx.Gtk3/UI/OpenGLRenderer.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using Ryujinx.Input.HLE; diff --git a/src/Ryujinx.Gtk3/UI/SPBOpenGLContext.cs b/src/Ryujinx.Gtk3/UI/SPBOpenGLContext.cs index 97feb4345..fde176220 100644 --- a/src/Ryujinx.Gtk3/UI/SPBOpenGLContext.cs +++ b/src/Ryujinx.Gtk3/UI/SPBOpenGLContext.cs @@ -1,4 +1,4 @@ -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Graphics.OpenGL; using SPB.Graphics; using SPB.Graphics.OpenGL; diff --git a/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs b/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs index 7ea6e1481..9ac0408ab 100644 --- a/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs +++ b/src/Ryujinx.Headless.SDL2/OpenGL/OpenGLWindow.cs @@ -1,5 +1,5 @@ using OpenTK; -using OpenTK.Graphics.OpenGL; +using Silk.NET.OpenGL; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using Ryujinx.Graphics.OpenGL;