mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-07 16:33:05 +00:00
Cleanup IntPtr casts
This commit is contained in:
parent
38d900c932
commit
e46b671875
3 changed files with 8 additions and 7 deletions
|
@ -7,6 +7,7 @@ using Ryujinx.Graphics.OpenGL.Queries;
|
||||||
using Ryujinx.Graphics.Shader.Translation;
|
using Ryujinx.Graphics.Shader.Translation;
|
||||||
using Silk.NET.OpenGL.Legacy.Extensions.ARB;
|
using Silk.NET.OpenGL.Legacy.Extensions.ARB;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using Sampler = Ryujinx.Graphics.OpenGL.Image.Sampler;
|
using Sampler = Ryujinx.Graphics.OpenGL.Image.Sampler;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.OpenGL
|
namespace Ryujinx.Graphics.OpenGL
|
||||||
|
@ -247,11 +248,11 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
Api.ClampColor(ClampColorTargetARB.FragmentColorArb, ClampColorModeARB.False);
|
Api.ClampColor(ClampColorTargetARB.FragmentColorArb, ClampColorModeARB.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PrintGpuInformation()
|
private unsafe void PrintGpuInformation()
|
||||||
{
|
{
|
||||||
GpuVendor = Api.GetString(StringName.Vendor);
|
GpuVendor = Marshal.PtrToStringAnsi((IntPtr)Api.GetString(StringName.Vendor));
|
||||||
GpuRenderer = Api.GetString(StringName.Renderer);
|
GpuRenderer = Marshal.PtrToStringAnsi((IntPtr)Api.GetString(StringName.Renderer));
|
||||||
GpuVersion = Api.GetString(StringName.Version);
|
GpuVersion = Marshal.PtrToStringAnsi((IntPtr)Api.GetString(StringName.Version));
|
||||||
|
|
||||||
Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
|
Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
_api.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToUInt32());
|
_api.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToUInt32());
|
||||||
void* ptr = _api.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, (uint)size, MapBufferAccessMask.ReadBit | MapBufferAccessMask.PersistentBit);
|
void* ptr = _api.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, (uint)size, MapBufferAccessMask.ReadBit | MapBufferAccessMask.PersistentBit);
|
||||||
|
|
||||||
_maps[handle] = new IntPtr(ptr);
|
_maps[handle] = (IntPtr)ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unmap(BufferHandle handle)
|
public void Unmap(BufferHandle handle)
|
||||||
|
@ -89,7 +89,7 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
_api.BindBuffer(BufferTargetARB.CopyWriteBuffer, _copyBufferHandle);
|
_api.BindBuffer(BufferTargetARB.CopyWriteBuffer, _copyBufferHandle);
|
||||||
_api.BufferStorage(BufferStorageTarget.CopyWriteBuffer, (uint)requiredSize, IntPtr.Zero, BufferStorageMask.MapReadBit | BufferStorageMask.MapPersistentBit);
|
_api.BufferStorage(BufferStorageTarget.CopyWriteBuffer, (uint)requiredSize, IntPtr.Zero, BufferStorageMask.MapReadBit | BufferStorageMask.MapPersistentBit);
|
||||||
|
|
||||||
_bufferMap = new IntPtr(_api.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, (uint)requiredSize, MapBufferAccessMask.ReadBit | MapBufferAccessMask.PersistentBit));
|
_bufferMap = (IntPtr)_api.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, (uint)requiredSize, MapBufferAccessMask.ReadBit | MapBufferAccessMask.PersistentBit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
||||||
|
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
_bufferMap = new IntPtr(_api.MapBufferRange(BufferTargetARB.QueryBuffer, IntPtr.Zero, sizeof(long), MapBufferAccessMask.ReadBit | MapBufferAccessMask.WriteBit | MapBufferAccessMask.PersistentBit));
|
_bufferMap = (IntPtr)_api.MapBufferRange(BufferTargetARB.QueryBuffer, IntPtr.Zero, sizeof(long), MapBufferAccessMask.ReadBit | MapBufferAccessMask.WriteBit | MapBufferAccessMask.PersistentBit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue