diff --git a/src/ComputeSharp.Win32.D3D12/ComputeSharp.Win32.D3D12.projitems b/src/ComputeSharp.Win32.D3D12/ComputeSharp.Win32.D3D12.projitems index 69456bce..193d17bc 100644 --- a/src/ComputeSharp.Win32.D3D12/ComputeSharp.Win32.D3D12.projitems +++ b/src/ComputeSharp.Win32.D3D12/ComputeSharp.Win32.D3D12.projitems @@ -215,13 +215,9 @@ - - - - diff --git a/src/ComputeSharp.Win32.D3D12/DirectX/shared/dxgi1_4/IDXGIFactory4.cs b/src/ComputeSharp.Win32.D3D12/DirectX/shared/dxgi1_4/IDXGIFactory4.cs index 5d0ef5a8..05c8980c 100644 --- a/src/ComputeSharp.Win32.D3D12/DirectX/shared/dxgi1_4/IDXGIFactory4.cs +++ b/src/ComputeSharp.Win32.D3D12/DirectX/shared/dxgi1_4/IDXGIFactory4.cs @@ -39,34 +39,6 @@ internal unsafe partial struct IDXGIFactory4 return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGIFactory4*)Unsafe.AsPointer(ref this)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), Name, DataSize, pData); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), Name, pUnknown); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(5)] - public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), Name, pDataSize, pData); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(6)] - public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), riid, ppParent); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(7)] public HRESULT EnumAdapters(uint Adapter, IDXGIAdapter** ppAdapter) @@ -74,20 +46,6 @@ internal unsafe partial struct IDXGIFactory4 return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), Adapter, ppAdapter); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(8)] - public HRESULT MakeWindowAssociation(HWND WindowHandle, uint Flags) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[8]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), WindowHandle, Flags); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(9)] - public HRESULT GetWindowAssociation(HWND* pWindowHandle) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[9]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), pWindowHandle); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(12)] public HRESULT EnumAdapters1(uint Adapter, IDXGIAdapter1** ppAdapter) @@ -95,97 +53,6 @@ internal unsafe partial struct IDXGIFactory4 return ((delegate* unmanaged[Stdcall])(lpVtbl[12]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), Adapter, ppAdapter); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(13)] - public BOOL IsCurrent() - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((IDXGIFactory4*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(14)] - public BOOL IsWindowedStereoEnabled() - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[14]))((IDXGIFactory4*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(16)] - public HRESULT CreateSwapChainForCoreWindow(IUnknown* pDevice, IUnknown* pWindow, [NativeTypeName("const DXGI_SWAP_CHAIN_DESC1 *")] DXGI_SWAP_CHAIN_DESC1* pDesc, IDXGIOutput* pRestrictToOutput, IDXGISwapChain1** ppSwapChain) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[16]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), pDevice, pWindow, pDesc, pRestrictToOutput, ppSwapChain); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(17)] - public HRESULT GetSharedResourceAdapterLuid(HANDLE hResource, LUID* pLuid) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[17]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), hResource, pLuid); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(18)] - public HRESULT RegisterStereoStatusWindow(HWND WindowHandle, uint wMsg, [NativeTypeName("DWORD *")] uint* pdwCookie) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[18]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), WindowHandle, wMsg, pdwCookie); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(19)] - public HRESULT RegisterStereoStatusEvent(HANDLE hEvent, [NativeTypeName("DWORD *")] uint* pdwCookie) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[19]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), hEvent, pdwCookie); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(20)] - public void UnregisterStereoStatus([NativeTypeName("DWORD")] uint dwCookie) - { - ((delegate* unmanaged[Stdcall])(lpVtbl[20]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), dwCookie); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(21)] - public HRESULT RegisterOcclusionStatusWindow(HWND WindowHandle, uint wMsg, [NativeTypeName("DWORD *")] uint* pdwCookie) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[21]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), WindowHandle, wMsg, pdwCookie); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(22)] - public HRESULT RegisterOcclusionStatusEvent(HANDLE hEvent, [NativeTypeName("DWORD *")] uint* pdwCookie) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[22]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), hEvent, pdwCookie); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(23)] - public void UnregisterOcclusionStatus([NativeTypeName("DWORD")] uint dwCookie) - { - ((delegate* unmanaged[Stdcall])(lpVtbl[23]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), dwCookie); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(24)] - public HRESULT CreateSwapChainForComposition(IUnknown* pDevice, [NativeTypeName("const DXGI_SWAP_CHAIN_DESC1 *")] DXGI_SWAP_CHAIN_DESC1* pDesc, IDXGIOutput* pRestrictToOutput, IDXGISwapChain1** ppSwapChain) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[24]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), pDevice, pDesc, pRestrictToOutput, ppSwapChain); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(25)] - public uint GetCreationFlags() - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[25]))((IDXGIFactory4*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(26)] - public HRESULT EnumAdapterByLuid(LUID AdapterLuid, [NativeTypeName("const IID &")] Guid* riid, void** ppvAdapter) - { - return ((delegate* unmanaged[Stdcall])(lpVtbl[26]))((IDXGIFactory4*)Unsafe.AsPointer(ref this), AdapterLuid, riid, ppvAdapter); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(27)] public HRESULT EnumWarpAdapter([NativeTypeName("const IID &")] Guid* riid, void** ppvAdapter) diff --git a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/HWND.cs b/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/HWND.cs deleted file mode 100644 index fc536b74..00000000 --- a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/HWND.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -using System; - -namespace ComputeSharp.Win32; - -internal readonly unsafe partial struct HWND : IComparable, IComparable, IEquatable, IFormattable -{ - public readonly void* Value; - - public HWND(void* value) - { - Value = value; - } - - public static HWND INVALID_VALUE => new HWND((void*)(-1)); - - public static HWND NULL => new HWND(null); - - public static bool operator ==(HWND left, HWND right) => left.Value == right.Value; - - public static bool operator !=(HWND left, HWND right) => left.Value != right.Value; - - public static bool operator <(HWND left, HWND right) => left.Value < right.Value; - - public static bool operator <=(HWND left, HWND right) => left.Value <= right.Value; - - public static bool operator >(HWND left, HWND right) => left.Value > right.Value; - - public static bool operator >=(HWND left, HWND right) => left.Value >= right.Value; - - public static explicit operator HWND(void* value) => new HWND(value); - - public static implicit operator void*(HWND value) => value.Value; - - public static explicit operator HWND(HANDLE value) => new HWND(value); - - public static implicit operator HANDLE(HWND value) => new HANDLE(value.Value); - - public static explicit operator HWND(byte value) => new HWND((void*)(value)); - - public static explicit operator byte(HWND value) => (byte)(value.Value); - - public static explicit operator HWND(short value) => new HWND((void*)(value)); - - public static explicit operator short(HWND value) => (short)(value.Value); - - public static explicit operator HWND(int value) => new HWND((void*)(value)); - - public static explicit operator int(HWND value) => (int)(value.Value); - - public static explicit operator HWND(long value) => new HWND((void*)(value)); - - public static explicit operator long(HWND value) => (long)(value.Value); - - public static explicit operator HWND(nint value) => new HWND((void*)(value)); - - public static implicit operator nint(HWND value) => (nint)(value.Value); - - public static explicit operator HWND(sbyte value) => new HWND((void*)(value)); - - public static explicit operator sbyte(HWND value) => (sbyte)(value.Value); - - public static explicit operator HWND(ushort value) => new HWND((void*)(value)); - - public static explicit operator ushort(HWND value) => (ushort)(value.Value); - - public static explicit operator HWND(uint value) => new HWND((void*)(value)); - - public static explicit operator uint(HWND value) => (uint)(value.Value); - - public static explicit operator HWND(ulong value) => new HWND((void*)(value)); - - public static explicit operator ulong(HWND value) => (ulong)(value.Value); - - public static explicit operator HWND(nuint value) => new HWND((void*)(value)); - - public static implicit operator nuint(HWND value) => (nuint)(value.Value); - - public int CompareTo(object? obj) - { - if (obj is HWND other) - { - return CompareTo(other); - } - - return (obj is null) ? 1 : throw new ArgumentException("obj is not an instance of HWND."); - } - - public int CompareTo(HWND other) => ((nuint)(Value)).CompareTo((nuint)(other.Value)); - - public override bool Equals(object? obj) => (obj is HWND other) && Equals(other); - - public bool Equals(HWND other) => ((nuint)(Value)).Equals((nuint)(other.Value)); - - public override int GetHashCode() => ((nuint)(Value)).GetHashCode(); - - public override string ToString() => ((nuint)(Value)).ToString((sizeof(nint) == 4) ? "X8" : "X16"); - - public string ToString(string? format, IFormatProvider? formatProvider) => ((nuint)(Value)).ToString(format, formatProvider); -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/LPARAM.cs b/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/LPARAM.cs deleted file mode 100644 index a0ff8e3a..00000000 --- a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/LPARAM.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -using System; - -namespace ComputeSharp.Win32; - -internal readonly unsafe partial struct LPARAM : IComparable, IComparable, IEquatable, IFormattable -{ - public readonly nint Value; - - public LPARAM(nint value) - { - Value = value; - } - - public static bool operator ==(LPARAM left, LPARAM right) => left.Value == right.Value; - - public static bool operator !=(LPARAM left, LPARAM right) => left.Value != right.Value; - - public static bool operator <(LPARAM left, LPARAM right) => left.Value < right.Value; - - public static bool operator <=(LPARAM left, LPARAM right) => left.Value <= right.Value; - - public static bool operator >(LPARAM left, LPARAM right) => left.Value > right.Value; - - public static bool operator >=(LPARAM left, LPARAM right) => left.Value >= right.Value; - - public static implicit operator LPARAM(byte value) => new LPARAM(value); - - public static explicit operator byte(LPARAM value) => (byte)(value.Value); - - public static implicit operator LPARAM(short value) => new LPARAM(value); - - public static explicit operator short(LPARAM value) => (short)(value.Value); - - public static implicit operator LPARAM(int value) => new LPARAM(value); - - public static explicit operator int(LPARAM value) => (int)(value.Value); - - public static explicit operator LPARAM(long value) => new LPARAM((nint)(value)); - - public static implicit operator long(LPARAM value) => value.Value; - - public static implicit operator LPARAM(nint value) => new LPARAM(value); - - public static implicit operator nint(LPARAM value) => value.Value; - - public static implicit operator LPARAM(sbyte value) => new LPARAM(value); - - public static explicit operator sbyte(LPARAM value) => (sbyte)(value.Value); - - public static implicit operator LPARAM(ushort value) => new LPARAM(value); - - public static explicit operator ushort(LPARAM value) => (ushort)(value.Value); - - public static explicit operator LPARAM(uint value) => new LPARAM((nint)(value)); - - public static explicit operator uint(LPARAM value) => (uint)(value.Value); - - public static explicit operator LPARAM(ulong value) => new LPARAM((nint)(value)); - - public static explicit operator ulong(LPARAM value) => (ulong)(value.Value); - - public static explicit operator LPARAM(nuint value) => new LPARAM((nint)(value)); - - public static explicit operator nuint(LPARAM value) => (nuint)(value.Value); - - public int CompareTo(object? obj) - { - if (obj is LPARAM other) - { - return CompareTo(other); - } - - return (obj is null) ? 1 : throw new ArgumentException("obj is not an instance of LPARAM."); - } - - public int CompareTo(LPARAM other) => Value.CompareTo(other.Value); - - public override bool Equals(object? obj) => (obj is LPARAM other) && Equals(other); - - public bool Equals(LPARAM other) => Value.Equals(other.Value); - - public override int GetHashCode() => Value.GetHashCode(); - - public override string ToString() => Value.ToString((sizeof(nint) == 4) ? "X8" : "X16"); - - public string ToString(string? format, IFormatProvider? formatProvider) => Value.ToString(format, formatProvider); -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/LRESULT.cs b/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/LRESULT.cs deleted file mode 100644 index 0483721d..00000000 --- a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/LRESULT.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -using System; - -namespace ComputeSharp.Win32; - -internal readonly partial struct LRESULT : IComparable, IComparable, IEquatable, IFormattable -{ - public readonly nint Value; - - public LRESULT(nint value) - { - Value = value; - } - - public static bool operator ==(LRESULT left, LRESULT right) => left.Value == right.Value; - - public static bool operator !=(LRESULT left, LRESULT right) => left.Value != right.Value; - - public static bool operator <(LRESULT left, LRESULT right) => left.Value < right.Value; - - public static bool operator <=(LRESULT left, LRESULT right) => left.Value <= right.Value; - - public static bool operator >(LRESULT left, LRESULT right) => left.Value > right.Value; - - public static bool operator >=(LRESULT left, LRESULT right) => left.Value >= right.Value; - - public static implicit operator LRESULT(byte value) => new LRESULT(value); - - public static explicit operator byte(LRESULT value) => (byte)(value.Value); - - public static implicit operator LRESULT(short value) => new LRESULT(value); - - public static explicit operator short(LRESULT value) => (short)(value.Value); - - public static implicit operator LRESULT(int value) => new LRESULT(value); - - public static explicit operator int(LRESULT value) => (int)(value.Value); - - public static explicit operator LRESULT(long value) => new LRESULT((nint)(value)); - - public static implicit operator long(LRESULT value) => value.Value; - - public static implicit operator LRESULT(nint value) => new LRESULT(value); - - public static implicit operator nint(LRESULT value) => value.Value; - - public static implicit operator LRESULT(sbyte value) => new LRESULT(value); - - public static explicit operator sbyte(LRESULT value) => (sbyte)(value.Value); - - public static implicit operator LRESULT(ushort value) => new LRESULT(value); - - public static explicit operator ushort(LRESULT value) => (ushort)(value.Value); - - public static explicit operator LRESULT(uint value) => new LRESULT((nint)(value)); - - public static explicit operator uint(LRESULT value) => (uint)(value.Value); - - public static explicit operator LRESULT(ulong value) => new LRESULT((nint)(value)); - - public static explicit operator ulong(LRESULT value) => (ulong)(value.Value); - - public static explicit operator LRESULT(nuint value) => new LRESULT((nint)(value)); - - public static explicit operator nuint(LRESULT value) => (nuint)(value.Value); - - public int CompareTo(object? obj) - { - if (obj is LRESULT other) - { - return CompareTo(other); - } - - return (obj is null) ? 1 : throw new ArgumentException("obj is not an instance of LRESULT."); - } - - public int CompareTo(LRESULT other) => Value.CompareTo(other.Value); - - public override bool Equals(object? obj) => (obj is LRESULT other) && Equals(other); - - public bool Equals(LRESULT other) => Value.Equals(other.Value); - - public override int GetHashCode() => Value.GetHashCode(); - - public override string ToString() => Value.ToString(); - - public string ToString(string? format, IFormatProvider? formatProvider) => Value.ToString(format, formatProvider); -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/WPARAM.cs b/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/WPARAM.cs deleted file mode 100644 index bd8377c8..00000000 --- a/src/ComputeSharp.Win32.D3D12/Windows/other/helper-types/WPARAM.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -using System; - -namespace ComputeSharp.Win32; - -internal readonly unsafe partial struct WPARAM : IComparable, IComparable, IEquatable, IFormattable -{ - public readonly nuint Value; - - public WPARAM(nuint value) - { - Value = value; - } - - public static bool operator ==(WPARAM left, WPARAM right) => left.Value == right.Value; - - public static bool operator !=(WPARAM left, WPARAM right) => left.Value != right.Value; - - public static bool operator <(WPARAM left, WPARAM right) => left.Value < right.Value; - - public static bool operator <=(WPARAM left, WPARAM right) => left.Value <= right.Value; - - public static bool operator >(WPARAM left, WPARAM right) => left.Value > right.Value; - - public static bool operator >=(WPARAM left, WPARAM right) => left.Value >= right.Value; - - public static implicit operator WPARAM(byte value) => new WPARAM(value); - - public static explicit operator byte(WPARAM value) => (byte)(value.Value); - - public static explicit operator WPARAM(short value) => new WPARAM((nuint)(value)); - - public static explicit operator short(WPARAM value) => (short)(value.Value); - - public static explicit operator WPARAM(int value) => new WPARAM((nuint)(value)); - - public static explicit operator int(WPARAM value) => (int)(value.Value); - - public static explicit operator WPARAM(long value) => new WPARAM((nuint)(value)); - - public static explicit operator long(WPARAM value) => (long)(value.Value); - - public static explicit operator WPARAM(nint value) => new WPARAM((nuint)(value)); - - public static explicit operator nint(WPARAM value) => (nint)(value.Value); - - public static explicit operator WPARAM(sbyte value) => new WPARAM((nuint)(value)); - - public static explicit operator sbyte(WPARAM value) => (sbyte)(value.Value); - - public static implicit operator WPARAM(ushort value) => new WPARAM(value); - - public static explicit operator ushort(WPARAM value) => (ushort)(value.Value); - - public static implicit operator WPARAM(uint value) => new WPARAM(value); - - public static explicit operator uint(WPARAM value) => (uint)(value.Value); - - public static explicit operator WPARAM(ulong value) => new WPARAM((nuint)(value)); - - public static implicit operator ulong(WPARAM value) => value.Value; - - public static implicit operator WPARAM(nuint value) => new WPARAM(value); - - public static implicit operator nuint(WPARAM value) => value.Value; - - public int CompareTo(object? obj) - { - if (obj is WPARAM other) - { - return CompareTo(other); - } - - return (obj is null) ? 1 : throw new ArgumentException("obj is not an instance of WPARAM."); - } - - public int CompareTo(WPARAM other) => Value.CompareTo(other.Value); - - public override bool Equals(object? obj) => (obj is WPARAM other) && Equals(other); - - public bool Equals(WPARAM other) => Value.Equals(other.Value); - - public override int GetHashCode() => Value.GetHashCode(); - - public override string ToString() => Value.ToString((sizeof(nint) == 4) ? "X8" : "X16"); - - public string ToString(string? format, IFormatProvider? formatProvider) => Value.ToString(format, formatProvider); -} \ No newline at end of file