mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-05 23:43:04 +00:00
Trivial renames
This commit is contained in:
parent
870988fcba
commit
c1c0ccbaf5
35 changed files with 256 additions and 256 deletions
|
@ -28,7 +28,6 @@
|
|||
<PackageVersion Include="NUnit" Version="3.13.3" />
|
||||
<PackageVersion Include="NUnit3TestAdapter" Version="4.1.0" />
|
||||
<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.Windowing.GraphicsLibraryFramework" Version="4.8.2" />
|
||||
<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="shaderc.net" Version="0.1.0" />
|
||||
<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.Extensions.EXT" 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="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
|
@ -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<BufferHandle>(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<BufferHandle>(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<byte>(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<byte> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Graphics.OpenGL.Image;
|
||||
using System;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Graphics.OpenGL.Image;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
|
||||
namespace Ryujinx.Graphics.OpenGL.Effects
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<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<int> _maximumComputeSharedMemorySize = new(() => GetLimit(All.MaxComputeSharedMemorySize));
|
||||
private static readonly Lazy<int> _storageBufferOffsetAlignment = new(() => GetLimit(All.ShaderStorageBufferOffsetAlignment));
|
||||
private static readonly Lazy<int> _textureBufferOffsetAlignment = new(() => GetLimit(All.TextureBufferOffsetAlignment));
|
||||
private static readonly Lazy<int> _maximumComputeSharedMemorySize = new(() => GetLimit(GLEnum.MaxComputeSharedMemorySize));
|
||||
private static readonly Lazy<int> _storageBufferOffsetAlignment = new(() => GetLimit(GLEnum.ShaderStorageBufferOffsetAlignment));
|
||||
private static readonly Lazy<int> _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<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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
|
||||
namespace Ryujinx.Graphics.OpenGL.Image
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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}."),
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Shader;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OpenTK.Graphics" />
|
||||
<PackageReference Include="Silk.NET.OpenGL" />
|
||||
<PackageReference Include="Silk.NET.OpenGL.Legacy" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Common.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.Graphics.Vulkan.Dependencies.MoltenVK" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'linux-arm64' AND '$(RuntimeIdentifier)' != 'win-x64'" />
|
||||
<PackageReference Include="OpenTK.Core" />
|
||||
<PackageReference Include="OpenTK.Graphics" />
|
||||
<PackageReference Include="SPB" />
|
||||
<PackageReference Include="SharpZipLib" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Input.HLE;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Silk.NET.OpenGL;
|
||||
using Ryujinx.Graphics.OpenGL;
|
||||
using SPB.Graphics;
|
||||
using SPB.Graphics.OpenGL;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue