Trivial renames

This commit is contained in:
Isaac Marovitz 2024-05-08 22:00:37 -04:00
parent 870988fcba
commit c1c0ccbaf5
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
35 changed files with 256 additions and 256 deletions

View file

@ -28,7 +28,6 @@
<PackageVersion Include="NUnit" Version="3.13.3" /> <PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.1.0" /> <PackageVersion Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageVersion Include="OpenTK.Core" Version="4.8.2" /> <PackageVersion Include="OpenTK.Core" Version="4.8.2" />
<PackageVersion Include="OpenTK.Graphics" Version="4.8.2" />
<PackageVersion Include="OpenTK.Audio.OpenAL" Version="4.8.2" /> <PackageVersion Include="OpenTK.Audio.OpenAL" Version="4.8.2" />
<PackageVersion Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.8.2" /> <PackageVersion Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.8.2" />
<PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" /> <PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" />
@ -39,6 +38,8 @@
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" /> <PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
<PackageVersion Include="shaderc.net" Version="0.1.0" /> <PackageVersion Include="shaderc.net" Version="0.1.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.2" /> <PackageVersion Include="SharpZipLib" Version="1.4.2" />
<PackageVersion Include="Silk.NET.OpenGL" Version="2.21.0" />
<PackageVersion Include="Silk.NET.OpenGL.Legacy" Version="2.21.0" />
<PackageVersion Include="Silk.NET.Vulkan" Version="2.16.0" /> <PackageVersion Include="Silk.NET.Vulkan" Version="2.16.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" /> <PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" /> <PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
@ -49,4 +50,4 @@
<PackageVersion Include="System.Management" Version="8.0.0" /> <PackageVersion Include="System.Management" Version="8.0.0" />
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" /> <PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
public static void Clear(BufferHandle destination, int offset, int size, uint value) 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 unsafe
{ {
@ -17,8 +17,8 @@ namespace Ryujinx.Graphics.OpenGL
valueArr[0] = value; valueArr[0] = value;
GL.ClearBufferSubData( GL.ClearBufferSubData(
BufferTarget.CopyWriteBuffer, BufferTargetARB.CopyWriteBuffer,
PixelInternalFormat.Rgba8ui, InternalFormat.Rgba8ui,
(IntPtr)offset, (IntPtr)offset,
(IntPtr)size, (IntPtr)size,
PixelFormat.RgbaInteger, PixelFormat.RgbaInteger,
@ -36,8 +36,8 @@ namespace Ryujinx.Graphics.OpenGL
{ {
int handle = GL.GenBuffer(); int handle = GL.GenBuffer();
GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle);
GL.BufferData(BufferTarget.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageHint.DynamicDraw); GL.BufferData(BufferTargetARB.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageARB.DynamicDraw);
return Handle.FromInt32<BufferHandle>(handle); return Handle.FromInt32<BufferHandle>(handle);
} }
@ -46,24 +46,24 @@ namespace Ryujinx.Graphics.OpenGL
{ {
int handle = GL.GenBuffer(); int handle = GL.GenBuffer();
GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle);
GL.BufferStorage(BufferTarget.CopyWriteBuffer, size, IntPtr.Zero, GL.BufferStorage(BufferTargetARB.CopyWriteBuffer, size, IntPtr.Zero,
BufferStorageFlags.MapPersistentBit | BufferStorageMask.MapPersistentBit |
BufferStorageFlags.MapCoherentBit | BufferStorageMask.MapCoherentBit |
BufferStorageFlags.ClientStorageBit | BufferStorageMask.ClientStorageBit |
BufferStorageFlags.MapReadBit); BufferStorageMask.MapReadBit);
return Handle.FromInt32<BufferHandle>(handle); return Handle.FromInt32<BufferHandle>(handle);
} }
public static void Copy(BufferHandle source, BufferHandle destination, int srcOffset, int dstOffset, int size) public static void Copy(BufferHandle source, BufferHandle destination, int srcOffset, int dstOffset, int size)
{ {
GL.BindBuffer(BufferTarget.CopyReadBuffer, source.ToInt32()); GL.BindBuffer(BufferTargetARB.CopyReadBuffer, source.ToInt32());
GL.BindBuffer(BufferTarget.CopyWriteBuffer, destination.ToInt32()); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, destination.ToInt32());
GL.CopyBufferSubData( GL.CopyBufferSubData(
BufferTarget.CopyReadBuffer, BufferTargetARB.CopyReadBuffer,
BufferTarget.CopyWriteBuffer, BufferTargetARB.CopyWriteBuffer,
(IntPtr)srcOffset, (IntPtr)srcOffset,
(IntPtr)dstOffset, (IntPtr)dstOffset,
(IntPtr)size); (IntPtr)size);
@ -86,9 +86,9 @@ namespace Ryujinx.Graphics.OpenGL
{ {
IntPtr target = renderer.PersistentBuffers.Default.GetHostArray(size); 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<byte>(target.ToPointer(), size); return new PinnedSpan<byte>(target.ToPointer(), size);
} }
@ -96,19 +96,19 @@ namespace Ryujinx.Graphics.OpenGL
public static void Resize(BufferHandle handle, int size) public static void Resize(BufferHandle handle, int size)
{ {
GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle.ToInt32()); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToInt32());
GL.BufferData(BufferTarget.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageHint.StreamCopy); GL.BufferData(BufferTargetARB.CopyWriteBuffer, size, IntPtr.Zero, BufferUsageARB.StreamCopy);
} }
public static void SetData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data) public static void SetData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data)
{ {
GL.BindBuffer(BufferTarget.CopyWriteBuffer, buffer.ToInt32()); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, buffer.ToInt32());
unsafe unsafe
{ {
fixed (byte* ptr = data) fixed (byte* ptr = data)
{ {
GL.BufferSubData(BufferTarget.CopyWriteBuffer, (IntPtr)offset, data.Length, (IntPtr)ptr); GL.BufferSubData(BufferTargetARB.CopyWriteBuffer, (IntPtr)offset, data.Length, (IntPtr)ptr);
} }
} }
} }

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using System; using System;
@ -16,7 +16,7 @@ namespace Ryujinx.Graphics.OpenGL
public static void Initialize(GraphicsDebugLevel logLevel) public static void Initialize(GraphicsDebugLevel logLevel)
{ {
// Disable everything // 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) if (logLevel == GraphicsDebugLevel.None)
{ {
@ -30,16 +30,16 @@ namespace Ryujinx.Graphics.OpenGL
if (logLevel == GraphicsDebugLevel.Error) 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) else if (logLevel == GraphicsDebugLevel.Slowdowns)
{ {
GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DebugTypeError, DebugSeverityControl.DontCare, 0, (int[])null, true); GL.DebugMessageControl(DebugSource.DontCare, DebugType.DebugTypeError, DebugSeverity.DontCare, 0, (int[])null, true);
GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DebugTypePerformance, DebugSeverityControl.DontCare, 0, (int[])null, true); GL.DebugMessageControl(DebugSource.DontCare, DebugType.DebugTypePerformance, DebugSeverity.DontCare, 0, (int[])null, true);
} }
else 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; _counter = 0;
@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
int counter = Interlocked.Increment(ref _counter); 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() 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) 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);
} }
} }
} }

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;
using System; using System;

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;
@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects
GL.ActiveTexture(TextureUnit.Texture0); GL.ActiveTexture(TextureUnit.Texture0);
int previousTextureBinding = GL.GetInteger(GetPName.TextureBinding2D); 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 threadGroupWorkRegionDim = 16;
int dispatchX = (width + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; int dispatchX = (width + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
@ -152,11 +152,11 @@ namespace Ryujinx.Graphics.OpenGL.Effects
GL.Uniform1(_scaleYUniform, scaleY); GL.Uniform1(_scaleYUniform, scaleY);
GL.DispatchCompute(dispatchX, dispatchY, 1); GL.DispatchCompute(dispatchX, dispatchY, 1);
GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit);
// Sharpening Pass // Sharpening Pass
GL.UseProgram(_sharpeningShaderProgram); 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); textureView.Bind(0);
GL.Uniform1(_inputUniform, 0); GL.Uniform1(_inputUniform, 0);
GL.Uniform1(_outputUniform, 0); GL.Uniform1(_outputUniform, 0);
@ -164,7 +164,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects
GL.DispatchCompute(dispatchX, dispatchY, 1); GL.DispatchCompute(dispatchX, dispatchY, 1);
GL.UseProgram(previousProgram); GL.UseProgram(previousProgram);
GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit);
(_renderer.Pipeline as Pipeline).RestoreImages1And2(); (_renderer.Pipeline as Pipeline).RestoreImages1And2();

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
namespace Ryujinx.Graphics.OpenGL.Effects namespace Ryujinx.Graphics.OpenGL.Effects
{ {

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;
@ -210,16 +210,16 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa
var dispatchY = BitUtils.DivRoundUp(view.Height, IPostProcessingEffect.LocalGroupSize); var dispatchY = BitUtils.DivRoundUp(view.Height, IPostProcessingEffect.LocalGroupSize);
int previousProgram = GL.GetInteger(GetPName.CurrentProgram); 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]); GL.UseProgram(_edgeShaderPrograms[Quality]);
view.Bind(0); view.Bind(0);
GL.Uniform1(_inputUniform, 0); GL.Uniform1(_inputUniform, 0);
GL.Uniform1(_outputUniform, 0); GL.Uniform1(_outputUniform, 0);
GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height); GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height);
GL.DispatchCompute(dispatchX, dispatchY, 1); 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]); GL.UseProgram(_blendShaderPrograms[Quality]);
edgeOutput.Bind(0); edgeOutput.Bind(0);
areaTexture.Bind(1); areaTexture.Bind(1);
@ -230,9 +230,9 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa
GL.Uniform1(_samplerSearchUniform, 2); GL.Uniform1(_samplerSearchUniform, 2);
GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height); GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height);
GL.DispatchCompute(dispatchX, dispatchY, 1); 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]); GL.UseProgram(_neighbourShaderPrograms[Quality]);
view.Bind(0); view.Bind(0);
blendOutput.Bind(1); blendOutput.Bind(1);
@ -241,7 +241,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa
GL.Uniform1(_samplerBlendUniform, 1); GL.Uniform1(_samplerBlendUniform, 1);
GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height); GL.Uniform2(_resolutionUniform, (float)view.Width, (float)view.Height);
GL.DispatchCompute(dispatchX, dispatchY, 1); GL.DispatchCompute(dispatchX, dispatchY, 1);
GL.MemoryBarrier(MemoryBarrierFlags.ShaderImageAccessBarrierBit); GL.MemoryBarrier(MemoryBarrierMask.ShaderImageAccessBarrierBit);
(_renderer.Pipeline as Pipeline).RestoreImages1And2(); (_renderer.Pipeline as Pipeline).RestoreImages1And2();

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Shader; using Ryujinx.Graphics.Shader;
@ -12,7 +12,7 @@ namespace Ryujinx.Graphics.OpenGL
switch (mode) switch (mode)
{ {
case AddressMode.Clamp: case AddressMode.Clamp:
return TextureWrapMode.Clamp; return GLEnum.Clamp;
case AddressMode.Repeat: case AddressMode.Repeat:
return TextureWrapMode.Repeat; return TextureWrapMode.Repeat;
case AddressMode.MirrorClamp: case AddressMode.MirrorClamp:
@ -154,94 +154,94 @@ namespace Ryujinx.Graphics.OpenGL
return All.UncorrelatedNv; return All.UncorrelatedNv;
} }
public static All Convert(this BlendFactor factor) public static GLEnum Convert(this BlendFactor factor)
{ {
switch (factor) switch (factor)
{ {
case BlendFactor.Zero: case BlendFactor.Zero:
case BlendFactor.ZeroGl: case BlendFactor.ZeroGl:
return All.Zero; return GLEnum.Zero;
case BlendFactor.One: case BlendFactor.One:
case BlendFactor.OneGl: case BlendFactor.OneGl:
return All.One; return GLEnum.One;
case BlendFactor.SrcColor: case BlendFactor.SrcColor:
case BlendFactor.SrcColorGl: case BlendFactor.SrcColorGl:
return All.SrcColor; return GLEnum.SrcColor;
case BlendFactor.OneMinusSrcColor: case BlendFactor.OneMinusSrcColor:
case BlendFactor.OneMinusSrcColorGl: case BlendFactor.OneMinusSrcColorGl:
return All.OneMinusSrcColor; return GLEnum.OneMinusSrcColor;
case BlendFactor.SrcAlpha: case BlendFactor.SrcAlpha:
case BlendFactor.SrcAlphaGl: case BlendFactor.SrcAlphaGl:
return All.SrcAlpha; return GLEnum.SrcAlpha;
case BlendFactor.OneMinusSrcAlpha: case BlendFactor.OneMinusSrcAlpha:
case BlendFactor.OneMinusSrcAlphaGl: case BlendFactor.OneMinusSrcAlphaGl:
return All.OneMinusSrcAlpha; return GLEnum.OneMinusSrcAlpha;
case BlendFactor.DstAlpha: case BlendFactor.DstAlpha:
case BlendFactor.DstAlphaGl: case BlendFactor.DstAlphaGl:
return All.DstAlpha; return GLEnum.DstAlpha;
case BlendFactor.OneMinusDstAlpha: case BlendFactor.OneMinusDstAlpha:
case BlendFactor.OneMinusDstAlphaGl: case BlendFactor.OneMinusDstAlphaGl:
return All.OneMinusDstAlpha; return GLEnum.OneMinusDstAlpha;
case BlendFactor.DstColor: case BlendFactor.DstColor:
case BlendFactor.DstColorGl: case BlendFactor.DstColorGl:
return All.DstColor; return GLEnum.DstColor;
case BlendFactor.OneMinusDstColor: case BlendFactor.OneMinusDstColor:
case BlendFactor.OneMinusDstColorGl: case BlendFactor.OneMinusDstColorGl:
return All.OneMinusDstColor; return GLEnum.OneMinusDstColor;
case BlendFactor.SrcAlphaSaturate: case BlendFactor.SrcAlphaSaturate:
case BlendFactor.SrcAlphaSaturateGl: case BlendFactor.SrcAlphaSaturateGl:
return All.SrcAlphaSaturate; return GLEnum.SrcAlphaSaturate;
case BlendFactor.Src1Color: case BlendFactor.Src1Color:
case BlendFactor.Src1ColorGl: case BlendFactor.Src1ColorGl:
return All.Src1Color; return GLEnum.Src1Color;
case BlendFactor.OneMinusSrc1Color: case BlendFactor.OneMinusSrc1Color:
case BlendFactor.OneMinusSrc1ColorGl: case BlendFactor.OneMinusSrc1ColorGl:
return All.OneMinusSrc1Color; return GLEnum.OneMinusSrc1Color;
case BlendFactor.Src1Alpha: case BlendFactor.Src1Alpha:
case BlendFactor.Src1AlphaGl: case BlendFactor.Src1AlphaGl:
return All.Src1Alpha; return GLEnum.Src1Alpha;
case BlendFactor.OneMinusSrc1Alpha: case BlendFactor.OneMinusSrc1Alpha:
case BlendFactor.OneMinusSrc1AlphaGl: case BlendFactor.OneMinusSrc1AlphaGl:
return All.OneMinusSrc1Alpha; return GLEnum.OneMinusSrc1Alpha;
case BlendFactor.ConstantColor: case BlendFactor.ConstantColor:
return All.ConstantColor; return GLEnum.ConstantColor;
case BlendFactor.OneMinusConstantColor: case BlendFactor.OneMinusConstantColor:
return All.OneMinusConstantColor; return GLEnum.OneMinusConstantColor;
case BlendFactor.ConstantAlpha: case BlendFactor.ConstantAlpha:
return All.ConstantAlpha; return GLEnum.ConstantAlpha;
case BlendFactor.OneMinusConstantAlpha: case BlendFactor.OneMinusConstantAlpha:
return All.OneMinusConstantAlpha; return GLEnum.OneMinusConstantAlpha;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(BlendFactor)} enum value: {factor}."); 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) switch (op)
{ {
case BlendOp.Add: case BlendOp.Add:
case BlendOp.AddGl: case BlendOp.AddGl:
return BlendEquationMode.FuncAdd; return GLEnum.FuncAdd;
case BlendOp.Minimum: case BlendOp.Minimum:
case BlendOp.MinimumGl: case BlendOp.MinimumGl:
return BlendEquationMode.Min; return GLEnum.Min;
case BlendOp.Maximum: case BlendOp.Maximum:
case BlendOp.MaximumGl: case BlendOp.MaximumGl:
return BlendEquationMode.Max; return GLEnum.Max;
case BlendOp.Subtract: case BlendOp.Subtract:
case BlendOp.SubtractGl: case BlendOp.SubtractGl:
return BlendEquationMode.FuncSubtract; return GLEnum.FuncSubtract;
case BlendOp.ReverseSubtract: case BlendOp.ReverseSubtract:
case BlendOp.ReverseSubtractGl: case BlendOp.ReverseSubtractGl:
return BlendEquationMode.FuncReverseSubtract; return GLEnum.FuncReverseSubtract;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}.");
return BlendEquationMode.FuncAdd; return GLEnum.FuncAdd;
} }
public static TextureCompareMode Convert(this CompareMode mode) public static TextureCompareMode Convert(this CompareMode mode)
@ -251,7 +251,7 @@ namespace Ryujinx.Graphics.OpenGL
case CompareMode.None: case CompareMode.None:
return TextureCompareMode.None; return TextureCompareMode.None;
case CompareMode.CompareRToTexture: case CompareMode.CompareRToTexture:
return TextureCompareMode.CompareRToTexture; return TextureCompareMode.CompareRefToTexture;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}.");
@ -259,86 +259,86 @@ namespace Ryujinx.Graphics.OpenGL
return TextureCompareMode.None; return TextureCompareMode.None;
} }
public static All Convert(this CompareOp op) public static GLEnum Convert(this CompareOp op)
{ {
switch (op) switch (op)
{ {
case CompareOp.Never: case CompareOp.Never:
case CompareOp.NeverGl: case CompareOp.NeverGl:
return All.Never; return GLEnum.Never;
case CompareOp.Less: case CompareOp.Less:
case CompareOp.LessGl: case CompareOp.LessGl:
return All.Less; return GLEnum.Less;
case CompareOp.Equal: case CompareOp.Equal:
case CompareOp.EqualGl: case CompareOp.EqualGl:
return All.Equal; return GLEnum.Equal;
case CompareOp.LessOrEqual: case CompareOp.LessOrEqual:
case CompareOp.LessOrEqualGl: case CompareOp.LessOrEqualGl:
return All.Lequal; return GLEnum.Lequal;
case CompareOp.Greater: case CompareOp.Greater:
case CompareOp.GreaterGl: case CompareOp.GreaterGl:
return All.Greater; return GLEnum.Greater;
case CompareOp.NotEqual: case CompareOp.NotEqual:
case CompareOp.NotEqualGl: case CompareOp.NotEqualGl:
return All.Notequal; return GLEnum.Notequal;
case CompareOp.GreaterOrEqual: case CompareOp.GreaterOrEqual:
case CompareOp.GreaterOrEqualGl: case CompareOp.GreaterOrEqualGl:
return All.Gequal; return GLEnum.Gequal;
case CompareOp.Always: case CompareOp.Always:
case CompareOp.AlwaysGl: case CompareOp.AlwaysGl:
return All.Always; return GLEnum.Always;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(CompareOp)} enum value: {op}."); 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) switch (mode)
{ {
case DepthMode.MinusOneToOne: case DepthMode.MinusOneToOne:
return ClipDepthMode.NegativeOneToOne; return GLEnum.NegativeOneToOne;
case DepthMode.ZeroToOne: case DepthMode.ZeroToOne:
return ClipDepthMode.ZeroToOne; return GLEnum.ZeroToOne;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(DepthMode)} enum value: {mode}."); 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) switch (mode)
{ {
case DepthStencilMode.Depth: case DepthStencilMode.Depth:
return All.DepthComponent; return GLEnum.DepthComponent;
case DepthStencilMode.Stencil: case DepthStencilMode.Stencil:
return All.StencilIndex; return GLEnum.StencilIndex;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}."); 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) switch (face)
{ {
case Face.Back: case Face.Back:
return CullFaceMode.Back; return GLEnum.Back;
case Face.Front: case Face.Front:
return CullFaceMode.Front; return GLEnum.Front;
case Face.FrontAndBack: case Face.FrontAndBack:
return CullFaceMode.FrontAndBack; return GLEnum.FrontAndBack;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}.");
return CullFaceMode.Back; return GLEnum.Back;
} }
public static FrontFaceDirection Convert(this FrontFace frontFace) public static FrontFaceDirection Convert(this FrontFace frontFace)
@ -346,14 +346,14 @@ namespace Ryujinx.Graphics.OpenGL
switch (frontFace) switch (frontFace)
{ {
case FrontFace.Clockwise: case FrontFace.Clockwise:
return FrontFaceDirection.Cw; return FrontFaceDirection.CW;
case FrontFace.CounterClockwise: case FrontFace.CounterClockwise:
return FrontFaceDirection.Ccw; return FrontFaceDirection.Ccw;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}.");
return FrontFaceDirection.Cw; return FrontFaceDirection.CW;
} }
public static DrawElementsType Convert(this IndexType type) public static DrawElementsType Convert(this IndexType type)
@ -411,21 +411,21 @@ namespace Ryujinx.Graphics.OpenGL
return TextureMinFilter.Nearest; 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) switch (mode)
{ {
case GAL.PolygonMode.Point: case GAL.PolygonMode.Point:
return OpenTK.Graphics.OpenGL.PolygonMode.Point; return Silk.NET.OpenGL.PolygonMode.Point;
case GAL.PolygonMode.Line: case GAL.PolygonMode.Line:
return OpenTK.Graphics.OpenGL.PolygonMode.Line; return Silk.NET.OpenGL.PolygonMode.Line;
case GAL.PolygonMode.Fill: 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}."); 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) public static PrimitiveType Convert(this PrimitiveTopology topology)
@ -615,47 +615,47 @@ namespace Ryujinx.Graphics.OpenGL
return NvViewportSwizzle.ViewportSwizzlePositiveXNv; return NvViewportSwizzle.ViewportSwizzlePositiveXNv;
} }
public static All Convert(this LogicalOp op) public static GLEnum Convert(this LogicalOp op)
{ {
switch (op) switch (op)
{ {
case LogicalOp.Clear: case LogicalOp.Clear:
return All.Clear; return GLEnum.Clear;
case LogicalOp.And: case LogicalOp.And:
return All.And; return GLEnum.And;
case LogicalOp.AndReverse: case LogicalOp.AndReverse:
return All.AndReverse; return GLEnum.AndReverse;
case LogicalOp.Copy: case LogicalOp.Copy:
return All.Copy; return GLEnum.Copy;
case LogicalOp.AndInverted: case LogicalOp.AndInverted:
return All.AndInverted; return GLEnum.AndInverted;
case LogicalOp.Noop: case LogicalOp.Noop:
return All.Noop; return GLEnum.Noop;
case LogicalOp.Xor: case LogicalOp.Xor:
return All.Xor; return GLEnum.Xor;
case LogicalOp.Or: case LogicalOp.Or:
return All.Or; return GLEnum.Or;
case LogicalOp.Nor: case LogicalOp.Nor:
return All.Nor; return GLEnum.Nor;
case LogicalOp.Equiv: case LogicalOp.Equiv:
return All.Equiv; return GLEnum.Equiv;
case LogicalOp.Invert: case LogicalOp.Invert:
return All.Invert; return GLEnum.Invert;
case LogicalOp.OrReverse: case LogicalOp.OrReverse:
return All.OrReverse; return GLEnum.OrReverse;
case LogicalOp.CopyInverted: case LogicalOp.CopyInverted:
return All.CopyInverted; return GLEnum.CopyInverted;
case LogicalOp.OrInverted: case LogicalOp.OrInverted:
return All.OrInverted; return GLEnum.OrInverted;
case LogicalOp.Nand: case LogicalOp.Nand:
return All.Nand; return GLEnum.Nand;
case LogicalOp.Set: case LogicalOp.Set:
return All.Set; return GLEnum.Set;
} }
Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(LogicalOp)} enum value: {op}."); Logger.Debug?.Print(LogClass.Gpu, $"Invalid {nameof(LogicalOp)} enum value: {op}.");
return All.Never; return GLEnum.Never;
} }
public static ShaderType Convert(this ShaderStage stage) public static ShaderType Convert(this ShaderStage stage)

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;
using System; using System;
@ -107,11 +107,11 @@ namespace Ryujinx.Graphics.OpenGL
private static void SetDrawBuffersImpl(int colorsCount) private static void SetDrawBuffersImpl(int colorsCount)
{ {
DrawBuffersEnum[] drawBuffers = new DrawBuffersEnum[colorsCount]; DrawBufferMode[] drawBuffers = new DrawBufferMode[colorsCount];
for (int index = 0; index < colorsCount; index++) for (int index = 0; index < colorsCount; index++)
{ {
drawBuffers[index] = DrawBuffersEnum.ColorAttachment0 + index; drawBuffers[index] = DrawBufferMode.ColorAttachment0 + index;
} }
GL.DrawBuffers(colorsCount, drawBuffers); GL.DrawBuffers(colorsCount, drawBuffers);

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using System; using System;
namespace Ryujinx.Graphics.OpenGL namespace Ryujinx.Graphics.OpenGL
@ -27,9 +27,9 @@ namespace Ryujinx.Graphics.OpenGL
private static readonly Lazy<bool> _supportsTextureShadowLod = new(() => HasExtension("GL_EXT_texture_shadow_lod")); private static readonly Lazy<bool> _supportsTextureShadowLod = new(() => HasExtension("GL_EXT_texture_shadow_lod"));
private static readonly Lazy<bool> _supportsViewportSwizzle = new(() => HasExtension("GL_NV_viewport_swizzle")); private static readonly Lazy<bool> _supportsViewportSwizzle = new(() => HasExtension("GL_NV_viewport_swizzle"));
private static readonly Lazy<int> _maximumComputeSharedMemorySize = new(() => GetLimit(All.MaxComputeSharedMemorySize)); private static readonly Lazy<int> _maximumComputeSharedMemorySize = new(() => GetLimit(GLEnum.MaxComputeSharedMemorySize));
private static readonly Lazy<int> _storageBufferOffsetAlignment = new(() => GetLimit(All.ShaderStorageBufferOffsetAlignment)); private static readonly Lazy<int> _storageBufferOffsetAlignment = new(() => GetLimit(GLEnum.ShaderStorageBufferOffsetAlignment));
private static readonly Lazy<int> _textureBufferOffsetAlignment = new(() => GetLimit(All.TextureBufferOffsetAlignment)); private static readonly Lazy<int> _textureBufferOffsetAlignment = new(() => GetLimit(GLEnum.TextureBufferOffsetAlignment));
public enum GpuVendor public enum GpuVendor
{ {
@ -47,7 +47,7 @@ namespace Ryujinx.Graphics.OpenGL
public static GpuVendor Vendor => _gpuVendor.Value; public static GpuVendor Vendor => _gpuVendor.Value;
private static readonly Lazy<float> _maxSupportedAnisotropy = new(GL.GetFloat((GetPName)All.MaxTextureMaxAnisotropy)); private static readonly Lazy<float> _maxSupportedAnisotropy = new(GL.GetFloat((GetPName)GLEnum.MaxTextureMaxAnisotropy));
public static bool UsePersistentBufferForFlush => _gpuVendor.Value == GpuVendor.AmdWindows || _gpuVendor.Value == GpuVendor.Nvidia; public static bool UsePersistentBufferForFlush => _gpuVendor.Value == GpuVendor.AmdWindows || _gpuVendor.Value == GpuVendor.Nvidia;
@ -98,7 +98,7 @@ namespace Ryujinx.Graphics.OpenGL
return false; return false;
} }
private static int GetLimit(All name) private static int GetLimit(GLEnum name)
{ {
return GL.GetInteger((GetPName)name); return GL.GetInteger((GetPName)name);
} }

View file

@ -1,6 +1,5 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System;
namespace Ryujinx.Graphics.OpenGL.Image namespace Ryujinx.Graphics.OpenGL.Image
{ {
@ -50,7 +49,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
{ {
if (_images[i].Handle == 0) 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 else
{ {
@ -58,7 +57,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
if (format != 0) 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);
} }
} }
} }

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
namespace Ryujinx.Graphics.OpenGL.Image namespace Ryujinx.Graphics.OpenGL.Image
@ -11,20 +11,20 @@ namespace Ryujinx.Graphics.OpenGL.Image
{ {
Handle = GL.GenSampler(); Handle = GL.GenSampler();
GL.SamplerParameter(Handle, SamplerParameterName.TextureMinFilter, (int)info.MinFilter.Convert()); GL.SamplerParameter(Handle, SamplerParameterI.MinFilter, (int)info.MinFilter.Convert());
GL.SamplerParameter(Handle, SamplerParameterName.TextureMagFilter, (int)info.MagFilter.Convert()); GL.SamplerParameter(Handle, SamplerParameterI.MagFilter, (int)info.MagFilter.Convert());
if (HwCapabilities.SupportsSeamlessCubemapPerTexture) if (HwCapabilities.SupportsSeamlessCubemapPerTexture)
{ {
GL.SamplerParameter(Handle, (SamplerParameterName)ArbSeamlessCubemapPerTexture.TextureCubeMapSeamless, info.SeamlessCubemap ? 1 : 0); GL.SamplerParameter(Handle, (SamplerParameterName)ArbSeamlessCubemapPerTexture.TextureCubeMapSeamless, info.SeamlessCubemap ? 1 : 0);
} }
GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapS, (int)info.AddressU.Convert()); GL.SamplerParameter(Handle, SamplerParameterI.WrapS, (int)info.AddressU.Convert());
GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapT, (int)info.AddressV.Convert()); GL.SamplerParameter(Handle, SamplerParameterI.WrapT, (int)info.AddressV.Convert());
GL.SamplerParameter(Handle, SamplerParameterName.TextureWrapR, (int)info.AddressP.Convert()); GL.SamplerParameter(Handle, SamplerParameterI.WrapR, (int)info.AddressP.Convert());
GL.SamplerParameter(Handle, SamplerParameterName.TextureCompareMode, (int)info.CompareMode.Convert()); GL.SamplerParameter(Handle, SamplerParameterI.CompareMode, (int)info.CompareMode.Convert());
GL.SamplerParameter(Handle, SamplerParameterName.TextureCompareFunc, (int)info.CompareOp.Convert()); GL.SamplerParameter(Handle, SamplerParameterI.CompareFunc, (int)info.CompareOp.Convert());
unsafe unsafe
{ {
@ -36,14 +36,14 @@ namespace Ryujinx.Graphics.OpenGL.Image
info.BorderColor.Alpha, 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, SamplerParameterF.TextureMinLod, info.MinLod);
GL.SamplerParameter(Handle, SamplerParameterName.TextureMaxLod, info.MaxLod); GL.SamplerParameter(Handle, SamplerParameterF.TextureMaxLod, info.MaxLod);
GL.SamplerParameter(Handle, SamplerParameterName.TextureLodBias, info.MipLodBias); 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) public void Bind(int unit)

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
namespace Ryujinx.Graphics.OpenGL.Image namespace Ryujinx.Graphics.OpenGL.Image

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
using System.Buffers; using System.Buffers;
@ -95,9 +95,9 @@ namespace Ryujinx.Graphics.OpenGL.Image
Bind(0); 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() public void Dispose()

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
@ -348,16 +348,16 @@ namespace Ryujinx.Graphics.OpenGL.Image
EnsurePbo(from); EnsurePbo(from);
GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyPboHandle); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyPboHandle);
from.WriteToPbo(0, forceBgra: true); from.WriteToPbo(0, forceBgra: true);
GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0);
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, _copyPboHandle); GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, _copyPboHandle);
to.ReadFromPbo(0, _copyPboSize); to.ReadFromPbo(0, _copyPboSize);
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0); GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, 0);
return to; return to;
} }
@ -393,7 +393,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
EnsurePbo(from); 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 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. // 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) if (to.Info.IsCompressed)
{ {
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockWidth, to.Info.BlockWidth); GL.PixelStore(GLEnum.UnpackCompressedBlockWidth, to.Info.BlockWidth);
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockHeight, to.Info.BlockHeight); GL.PixelStore(GLEnum.UnpackCompressedBlockHeight, to.Info.BlockHeight);
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockDepth, 1); GL.PixelStore(GLEnum.UnpackCompressedBlockDepth, 1);
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockSize, to.Info.BytesPerPixel); GL.PixelStore(GLEnum.UnpackCompressedBlockSize, to.Info.BytesPerPixel);
} }
} }
GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0);
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, _copyPboHandle); GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, _copyPboHandle);
to.ReadFromPbo2D(offset, dstLayer, dstLevel, dstWidth, dstHeight); to.ReadFromPbo2D(offset, dstLayer, dstLevel, dstWidth, dstHeight);
@ -432,14 +432,14 @@ namespace Ryujinx.Graphics.OpenGL.Image
if (to.Info.IsCompressed) if (to.Info.IsCompressed)
{ {
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockWidth, 0); GL.PixelStore(GLEnum.UnpackCompressedBlockWidth, 0);
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockHeight, 0); GL.PixelStore(GLEnum.UnpackCompressedBlockHeight, 0);
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockDepth, 0); GL.PixelStore(GLEnum.UnpackCompressedBlockDepth, 0);
GL.PixelStore(PixelStoreParameter.UnpackCompressedBlockSize, 0); GL.PixelStore(GLEnum.UnpackCompressedBlockSize, 0);
} }
} }
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0); GL.BindBuffer(BufferTargetARB.PixelUnpackBuffer, 0);
} }
private void EnsurePbo(TextureView view) private void EnsurePbo(TextureView view)
@ -463,8 +463,8 @@ namespace Ryujinx.Graphics.OpenGL.Image
_copyPboHandle = GL.GenBuffer(); _copyPboHandle = GL.GenBuffer();
_copyPboSize = requiredSize; _copyPboSize = requiredSize;
GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyPboHandle); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyPboHandle);
GL.BufferData(BufferTarget.PixelPackBuffer, requiredSize, IntPtr.Zero, BufferUsageHint.DynamicCopy); GL.BufferData(BufferTargetARB.PixelPackBuffer, requiredSize, IntPtr.Zero, BufferUsageARB.DynamicCopy);
} }
} }

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@ -111,8 +111,8 @@ void main()
for (int z = 0; z < depth; z++) for (int z = 0; z < depth; z++)
{ {
GL.BindImageTexture(0, src.Handle, srcLevel + l, false, srcLayer + z, TextureAccess.ReadOnly, srcFormat); GL.BindImageTexture(0, src.Handle, srcLevel + l, false, srcLayer + z, BufferAccessARB.ReadOnly, srcFormat);
GL.BindImageTexture(1, dst.Handle, dstLevel + l, false, dstLayer + z, TextureAccess.WriteOnly, dstFormat); GL.BindImageTexture(1, dst.Handle, dstLevel + l, false, dstLayer + z, BufferAccessARB.WriteOnly, dstFormat);
GL.DispatchCompute((width + 31) / 32, (height + 31) / 32, 1); GL.DispatchCompute((width + 31) / 32, (height + 31) / 32, 1);
} }
@ -131,7 +131,7 @@ void main()
return componentsCount switch return componentsCount switch
{ {
1 => SizedInternalFormat.R8ui, 1 => SizedInternalFormat.R8ui,
2 => SizedInternalFormat.Rg8ui, 2 => SizedInternalFormat.RG8ui,
4 => SizedInternalFormat.Rgba8ui, 4 => SizedInternalFormat.Rgba8ui,
_ => throw new ArgumentException($"Invalid components count {componentsCount}."), _ => throw new ArgumentException($"Invalid components count {componentsCount}."),
}; };
@ -141,7 +141,7 @@ void main()
return componentsCount switch return componentsCount switch
{ {
1 => SizedInternalFormat.R16ui, 1 => SizedInternalFormat.R16ui,
2 => SizedInternalFormat.Rg16ui, 2 => SizedInternalFormat.RG16ui,
4 => SizedInternalFormat.Rgba16ui, 4 => SizedInternalFormat.Rgba16ui,
_ => throw new ArgumentException($"Invalid components count {componentsCount}."), _ => throw new ArgumentException($"Invalid components count {componentsCount}."),
}; };
@ -151,7 +151,7 @@ void main()
return componentsCount switch return componentsCount switch
{ {
1 => SizedInternalFormat.R32ui, 1 => SizedInternalFormat.R32ui,
2 => SizedInternalFormat.Rg32ui, 2 => SizedInternalFormat.RG32ui,
4 => SizedInternalFormat.Rgba32ui, 4 => SizedInternalFormat.Rgba32ui,
_ => throw new ArgumentException($"Invalid components count {componentsCount}."), _ => throw new ArgumentException($"Invalid components count {componentsCount}."),
}; };

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
using System.Numerics; using System.Numerics;
@ -119,8 +119,8 @@ void main()
for (int z = 0; z < depth; z++) for (int z = 0; z < depth; z++)
{ {
GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, TextureAccess.ReadOnly, GetFormat(srcInfo.BytesPerPixel)); GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, BufferAccessARB.ReadOnly, GetFormat(srcInfo.BytesPerPixel));
GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, TextureAccess.WriteOnly, GetFormat(dstInfo.BytesPerPixel)); GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, BufferAccessARB.WriteOnly, GetFormat(dstInfo.BytesPerPixel));
GL.DispatchCompute((dstWidth + 31) / 32, (dstHeight + 31) / 32, 1); GL.DispatchCompute((dstWidth + 31) / 32, (dstHeight + 31) / 32, 1);
} }
@ -149,8 +149,8 @@ void main()
for (int z = 0; z < depth; z++) for (int z = 0; z < depth; z++)
{ {
GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, TextureAccess.ReadOnly, GetFormat(srcInfo.BytesPerPixel)); GL.BindImageTexture(0, srcHandle, 0, false, srcLayer + z, BufferAccessARB.ReadOnly, GetFormat(srcInfo.BytesPerPixel));
GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, TextureAccess.WriteOnly, GetFormat(dstInfo.BytesPerPixel)); GL.BindImageTexture(1, dstHandle, 0, false, dstLayer + z, BufferAccessARB.WriteOnly, GetFormat(dstInfo.BytesPerPixel));
GL.DispatchCompute((srcWidth + 31) / 32, (srcHeight + 31) / 32, 1); GL.DispatchCompute((srcWidth + 31) / 32, (srcHeight + 31) / 32, 1);
} }
@ -171,7 +171,7 @@ void main()
1 => SizedInternalFormat.R8ui, 1 => SizedInternalFormat.R8ui,
2 => SizedInternalFormat.R16ui, 2 => SizedInternalFormat.R16ui,
4 => SizedInternalFormat.R32ui, 4 => SizedInternalFormat.R32ui,
8 => SizedInternalFormat.Rg32ui, 8 => SizedInternalFormat.RG32ui,
16 => SizedInternalFormat.Rgba32ui, 16 => SizedInternalFormat.Rgba32ui,
_ => throw new ArgumentException($"Invalid bytes per pixel {bytesPerPixel}."), _ => throw new ArgumentException($"Invalid bytes per pixel {bytesPerPixel}."),
}; };
@ -189,7 +189,7 @@ void main()
handle, handle,
texture.Info.Target.Convert(), texture.Info.Target.Convert(),
texture.Storage.Handle, texture.Storage.Handle,
PixelInternalFormat.Rgba8, InternalFormat.Rgba8,
texture.FirstLevel, texture.FirstLevel,
1, 1,
texture.FirstLayer, texture.FirstLayer,

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
} }
else else
{ {
internalFormat = (SizedInternalFormat)format.PixelInternalFormat; internalFormat = (SizedInternalFormat)format.InternalFormat;
} }
int levels = Info.GetLevelsClamped(); int levels = Info.GetLevelsClamped();
@ -54,7 +54,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
{ {
case Target.Texture1D: case Target.Texture1D:
GL.TexStorage1D( GL.TexStorage1D(
TextureTarget1d.Texture1D, TextureTarget.Texture1D,
levels, levels,
internalFormat, internalFormat,
Info.Width); Info.Width);
@ -62,7 +62,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.Texture1DArray: case Target.Texture1DArray:
GL.TexStorage2D( GL.TexStorage2D(
TextureTarget2d.Texture1DArray, TextureTarget.Texture1DArray,
levels, levels,
internalFormat, internalFormat,
Info.Width, Info.Width,
@ -71,7 +71,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.Texture2D: case Target.Texture2D:
GL.TexStorage2D( GL.TexStorage2D(
TextureTarget2d.Texture2D, TextureTarget.Texture2D,
levels, levels,
internalFormat, internalFormat,
Info.Width, Info.Width,
@ -80,7 +80,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.Texture2DArray: case Target.Texture2DArray:
GL.TexStorage3D( GL.TexStorage3D(
TextureTarget3d.Texture2DArray, TextureTarget.Texture2DArray,
levels, levels,
internalFormat, internalFormat,
Info.Width, Info.Width,
@ -90,7 +90,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.Texture2DMultisample: case Target.Texture2DMultisample:
GL.TexStorage2DMultisample( GL.TexStorage2DMultisample(
TextureTargetMultisample2d.Texture2DMultisample, TextureTarget.Texture2DMultisample,
Info.Samples, Info.Samples,
internalFormat, internalFormat,
Info.Width, Info.Width,
@ -100,7 +100,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.Texture2DMultisampleArray: case Target.Texture2DMultisampleArray:
GL.TexStorage3DMultisample( GL.TexStorage3DMultisample(
TextureTargetMultisample3d.Texture2DMultisampleArray, TextureTarget.Texture2DMultisampleArray,
Info.Samples, Info.Samples,
internalFormat, internalFormat,
Info.Width, Info.Width,
@ -111,7 +111,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.Texture3D: case Target.Texture3D:
GL.TexStorage3D( GL.TexStorage3D(
TextureTarget3d.Texture3D, TextureTarget.Texture3D,
levels, levels,
internalFormat, internalFormat,
Info.Width, Info.Width,
@ -121,7 +121,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.Cubemap: case Target.Cubemap:
GL.TexStorage2D( GL.TexStorage2D(
TextureTarget2d.TextureCubeMap, TextureTarget.TextureCubeMap,
levels, levels,
internalFormat, internalFormat,
Info.Width, Info.Width,
@ -130,7 +130,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
case Target.CubemapArray: case Target.CubemapArray:
GL.TexStorage3D( GL.TexStorage3D(
(TextureTarget3d)All.TextureCubeMapArray, TextureTarget.TextureCubeMapArray,
levels, levels,
internalFormat, internalFormat,
Info.Width, Info.Width,

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
@ -40,15 +40,15 @@ namespace Ryujinx.Graphics.OpenGL.Image
FormatInfo format = FormatTable.GetFormatInfo(Info.Format); FormatInfo format = FormatTable.GetFormatInfo(Info.Format);
PixelInternalFormat pixelInternalFormat; InternalFormat pixelInternalFormat;
if (format.IsCompressed) if (format.IsCompressed)
{ {
pixelInternalFormat = (PixelInternalFormat)format.PixelFormat; pixelInternalFormat = (InternalFormat)format.PixelFormat;
} }
else else
{ {
pixelInternalFormat = format.PixelInternalFormat; pixelInternalFormat = format.InternalFormat;
} }
int levels = Info.GetLevelsClamped(); 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."); 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); FormatInfo format = FormatTable.GetFormatInfo(Info.Format);
if (format.PixelFormat == PixelFormat.DepthStencil) if (format.PixelFormat == PixelFormat.DepthStencil)
@ -334,7 +334,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
Debug.Assert(offset == 0); Debug.Assert(offset == 0);
GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0);
} }
public void WriteToPbo(int offset, bool forceBgra) public void WriteToPbo(int offset, bool forceBgra)
@ -405,9 +405,9 @@ namespace Ryujinx.Graphics.OpenGL.Image
{ {
if (pixelType == PixelType.UnsignedShort565) if (pixelType == PixelType.UnsignedShort565)
{ {
pixelType = PixelType.UnsignedShort565Reversed; pixelType = PixelType.UnsignedShort565Rev;
} }
else if (pixelType == PixelType.UnsignedShort565Reversed) else if (pixelType == PixelType.UnsignedShort565Rev)
{ {
pixelType = PixelType.UnsignedShort565; pixelType = PixelType.UnsignedShort565;
} }

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL; 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, // 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 // 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. // 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() private void PrintGpuInformation()

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;
@ -26,8 +26,8 @@ namespace Ryujinx.Graphics.OpenGL
public void Map(BufferHandle handle, int size) public void Map(BufferHandle handle, int size)
{ {
GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle.ToInt32()); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToInt32());
IntPtr ptr = GL.MapBufferRange(BufferTarget.CopyWriteBuffer, IntPtr.Zero, size, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit); IntPtr ptr = GL.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, size, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit);
_maps[handle] = ptr; _maps[handle] = ptr;
} }
@ -36,8 +36,8 @@ namespace Ryujinx.Graphics.OpenGL
{ {
if (_maps.ContainsKey(handle)) if (_maps.ContainsKey(handle))
{ {
GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle.ToInt32()); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToInt32());
GL.UnmapBuffer(BufferTarget.CopyWriteBuffer); GL.UnmapBuffer(BufferTargetARB.CopyWriteBuffer);
_maps.Remove(handle); _maps.Remove(handle);
} }
@ -72,10 +72,10 @@ namespace Ryujinx.Graphics.OpenGL
_copyBufferHandle = GL.GenBuffer(); _copyBufferHandle = GL.GenBuffer();
_copyBufferSize = requiredSize; _copyBufferSize = requiredSize;
GL.BindBuffer(BufferTarget.CopyWriteBuffer, _copyBufferHandle); GL.BindBuffer(BufferTargetARB.CopyWriteBuffer, _copyBufferHandle);
GL.BufferStorage(BufferTarget.CopyWriteBuffer, requiredSize, IntPtr.Zero, BufferStorageFlags.MapReadBit | BufferStorageFlags.MapPersistentBit); 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); EnsureBuffer(size);
GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyBufferHandle); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyBufferHandle);
view.WriteToPbo(0, false); view.WriteToPbo(0, false);
GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0);
Sync(); Sync();
@ -125,11 +125,11 @@ namespace Ryujinx.Graphics.OpenGL
{ {
EnsureBuffer(size); EnsureBuffer(size);
GL.BindBuffer(BufferTarget.PixelPackBuffer, _copyBufferHandle); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyBufferHandle);
int offset = view.WriteToPbo2D(0, layer, level); int offset = view.WriteToPbo2D(0, layer, level);
GL.BindBuffer(BufferTarget.PixelPackBuffer, 0); GL.BindBuffer(BufferTargetARB.PixelPackBuffer, 0);
Sync(); Sync();
@ -140,12 +140,12 @@ namespace Ryujinx.Graphics.OpenGL
{ {
EnsureBuffer(size); EnsureBuffer(size);
GL.BindBuffer(BufferTarget.CopyReadBuffer, buffer.ToInt32()); GL.BindBuffer(BufferTargetARB.CopyReadBuffer, buffer.ToInt32());
GL.BindBuffer(BufferTarget.CopyWriteBuffer, _copyBufferHandle); 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(); Sync();

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.OpenGL.Image; using Ryujinx.Graphics.OpenGL.Image;
@ -119,14 +119,14 @@ namespace Ryujinx.Graphics.OpenGL
{ {
_framebuffer.AttachColorLayerForClear(index, l); _framebuffer.AttachColorLayerForClear(index, l);
GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Color, index, colors); GL.ClearBuffer(BufferKind.Color, index, colors);
} }
_framebuffer.DetachColorLayerForClear(index); _framebuffer.DetachColorLayerForClear(index);
} }
else else
{ {
GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Color, index, colors); GL.ClearBuffer(BufferKind.Color, index, colors);
} }
RestoreComponentMask(index); RestoreComponentMask(index);
@ -187,11 +187,11 @@ namespace Ryujinx.Graphics.OpenGL
} }
else if (depthMask) else if (depthMask)
{ {
GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Depth, 0, ref depthValue); GL.ClearBuffer(BufferKind.Depth, 0, ref depthValue);
} }
else if (stencilMask != 0) 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(); PreDrawVbUnbounded();
GL.BindBuffer((BufferTarget)All.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32()); GL.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32());
GL.DrawArraysIndirect(_primitiveType, (IntPtr)indirectBuffer.Offset); GL.DrawArraysIndirect(_primitiveType, (IntPtr)indirectBuffer.Offset);
@ -651,8 +651,8 @@ namespace Ryujinx.Graphics.OpenGL
PreDrawVbUnbounded(); PreDrawVbUnbounded();
GL.BindBuffer((BufferTarget)All.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32()); GL.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToInt32());
GL.BindBuffer((BufferTarget)All.ParameterBuffer, parameterBuffer.Handle.ToInt32()); GL.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToInt32());
GL.MultiDrawArraysIndirectCount( GL.MultiDrawArraysIndirectCount(
_primitiveType, _primitiveType,

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Shader; using Ryujinx.Graphics.Shader;

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@ -24,14 +24,14 @@ namespace Ryujinx.Graphics.OpenGL.Queries
Query = GL.GenQuery(); Query = GL.GenQuery();
_type = type; _type = type;
GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); GL.BindBuffer(BufferTargetARB.QueryBuffer, _buffer);
unsafe unsafe
{ {
long defaultValue = DefaultValue; 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() public void Reset()
@ -51,11 +51,11 @@ namespace Ryujinx.Graphics.OpenGL.Queries
if (withResult) if (withResult)
{ {
GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); GL.BindBuffer(BufferTargetARB.QueryBuffer, _buffer);
Marshal.WriteInt64(_bufferMap, -1L); Marshal.WriteInt64(_bufferMap, -1L);
GL.GetQueryObject(Query, GetQueryObjectParam.QueryResult, (long*)0); GL.GetQueryObject(Query, GetQueryObjectParam.QueryResult, (long*)0);
GL.MemoryBarrier(MemoryBarrierFlags.QueryBufferBarrierBit | MemoryBarrierFlags.ClientMappedBufferBarrierBit); GL.MemoryBarrier(MemoryBarrierMask.QueryBufferBarrierBit | MemoryBarrierMask.ClientMappedBufferBarrierBit);
} }
else else
{ {
@ -111,8 +111,8 @@ namespace Ryujinx.Graphics.OpenGL.Queries
public void Dispose() public void Dispose()
{ {
GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); GL.BindBuffer(BufferTargetARB.QueryBuffer, _buffer);
GL.UnmapBuffer(BufferTarget.QueryBuffer); GL.UnmapBuffer(BufferTargetARB.QueryBuffer);
GL.DeleteBuffer(_buffer); GL.DeleteBuffer(_buffer);
GL.DeleteQuery(Query); GL.DeleteQuery(Query);
} }

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
using System.Threading; using System.Threading;
@ -62,7 +62,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries
return true; return true;
} }
if (ClearCounter || Type == QueryTarget.Timestamp) if (ClearCounter || Type == QueryTarget.TimeElapsed)
{ {
result = 0; result = 0;
} }

View file

@ -6,7 +6,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="OpenTK.Graphics" /> <PackageReference Include="Silk.NET.OpenGL" />
<PackageReference Include="Silk.NET.OpenGL.Legacy" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using System; using System;
using System.Numerics; using System.Numerics;
@ -134,19 +134,19 @@ namespace Ryujinx.Graphics.OpenGL
public void SetIndexBuffer(BufferRange range) public void SetIndexBuffer(BufferRange range)
{ {
_indexBuffer = range; _indexBuffer = range;
GL.BindBuffer(BufferTarget.ElementArrayBuffer, range.Handle.ToInt32()); GL.BindBuffer(BufferTargetARB.ElementArrayBuffer, range.Handle.ToInt32());
} }
public void SetRangeOfIndexBuffer() public void SetRangeOfIndexBuffer()
{ {
Buffer.Resize(_tempIndexBuffer, _indexBuffer.Size); Buffer.Resize(_tempIndexBuffer, _indexBuffer.Size);
Buffer.Copy(_indexBuffer.Handle, _tempIndexBuffer, _indexBuffer.Offset, 0, _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() public void RestoreIndexBuffer()
{ {
GL.BindBuffer(BufferTarget.ElementArrayBuffer, _indexBuffer.Handle.ToInt32()); GL.BindBuffer(BufferTargetARB.ElementArrayBuffer, _indexBuffer.Handle.ToInt32());
} }
public void PreDraw(int vertexCount) public void PreDraw(int vertexCount)

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.OpenGL.Effects; using Ryujinx.Graphics.OpenGL.Effects;
using Ryujinx.Graphics.OpenGL.Effects.Smaa; using Ryujinx.Graphics.OpenGL.Effects.Smaa;

View file

@ -27,7 +27,6 @@
<PackageReference Include="Ryujinx.Audio.OpenAL.Dependencies" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'linux-arm64' AND '$(RuntimeIdentifier)' != 'osx-x64' AND '$(RuntimeIdentifier)' != 'osx-arm64'" /> <PackageReference Include="Ryujinx.Audio.OpenAL.Dependencies" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'linux-arm64' AND '$(RuntimeIdentifier)' != 'osx-x64' AND '$(RuntimeIdentifier)' != 'osx-arm64'" />
<PackageReference Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'linux-arm64' AND '$(RuntimeIdentifier)' != 'win-x64'" /> <PackageReference Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'linux-arm64' AND '$(RuntimeIdentifier)' != 'win-x64'" />
<PackageReference Include="OpenTK.Core" /> <PackageReference Include="OpenTK.Core" />
<PackageReference Include="OpenTK.Graphics" />
<PackageReference Include="SPB" /> <PackageReference Include="SPB" />
<PackageReference Include="SharpZipLib" /> <PackageReference Include="SharpZipLib" />
<PackageReference Include="SixLabors.ImageSharp" /> <PackageReference Include="SixLabors.ImageSharp" />

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Input.HLE; using Ryujinx.Input.HLE;

View file

@ -1,4 +1,4 @@
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Graphics.OpenGL; using Ryujinx.Graphics.OpenGL;
using SPB.Graphics; using SPB.Graphics;
using SPB.Graphics.OpenGL; using SPB.Graphics.OpenGL;

View file

@ -1,5 +1,5 @@
using OpenTK; using OpenTK;
using OpenTK.Graphics.OpenGL; using Silk.NET.OpenGL;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Graphics.OpenGL; using Ryujinx.Graphics.OpenGL;