From 1963feacfbfe046b84bf8da3a3066cb490df7e4b Mon Sep 17 00:00:00 2001 From: John Date: Wed, 9 Sep 2020 21:50:31 +0100 Subject: [PATCH 01/14] Add D3D12On7 --- generation/other/d3d11on12on7/generate.rsp | 10 ++++ generation/other/d3d11on12on7/header.txt | 4 ++ .../other/d3d11on12on7/other-d3d11on12on7.h | 3 + generation/other/d3d12downlevel/generate.rsp | 12 ++++ generation/other/d3d12downlevel/header.txt | 4 ++ .../d3d12downlevel/other-d3d12downlevel.h | 2 + generation/other/d3dx12/generate.rsp | 8 +-- generation/other/dxcapi/generate.rsp | 8 +-- .../other/d3d11on12on7/ID3D11On12On7.cs | 56 +++++++++++++++++++ .../other/d3d11on12on7/ID3D11On12On7Device.cs | 26 +++++++++ .../Windows/other/d3d11on12on7/Windows.cs | 16 ++++++ .../D3D12_DOWNLEVEL_PRESENT_FLAGS.cs | 13 +++++ .../ID3D12CommandQueueDownlevel.cs | 42 ++++++++++++++ .../d3d12downlevel/ID3D12DeviceDownlevel.cs | 42 ++++++++++++++ .../Windows/other/d3d12downlevel/Windows.cs | 18 ++++++ .../d3d11on12on7/ID3D11On12On7DeviceTests.cs | 43 ++++++++++++++ .../other/d3d11on12on7/ID3D11On12On7Tests.cs | 43 ++++++++++++++ .../ID3D12CommandQueueDownlevelTests.cs | 51 +++++++++++++++++ .../ID3D12DeviceDownlevelTests.cs | 51 +++++++++++++++++ 19 files changed, 444 insertions(+), 8 deletions(-) create mode 100644 generation/other/d3d11on12on7/generate.rsp create mode 100644 generation/other/d3d11on12on7/header.txt create mode 100644 generation/other/d3d11on12on7/other-d3d11on12on7.h create mode 100644 generation/other/d3d12downlevel/generate.rsp create mode 100644 generation/other/d3d12downlevel/header.txt create mode 100644 generation/other/d3d12downlevel/other-d3d12downlevel.h create mode 100644 sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs create mode 100644 sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs create mode 100644 sources/Interop/Windows/other/d3d11on12on7/Windows.cs create mode 100644 sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs create mode 100644 sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs create mode 100644 sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs create mode 100644 sources/Interop/Windows/other/d3d12downlevel/Windows.cs create mode 100644 tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs create mode 100644 tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs create mode 100644 tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs create mode 100644 tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs diff --git a/generation/other/d3d11on12on7/generate.rsp b/generation/other/d3d11on12on7/generate.rsp new file mode 100644 index 0000000000..bdb242474d --- /dev/null +++ b/generation/other/d3d11on12on7/generate.rsp @@ -0,0 +1,10 @@ +@../../settings.rsp +@../../remap.rsp +--file +other-d3d11on12on7.h +--output +../../../sources/Interop/Windows/other/d3d11on12on7 +--test-output +../../../tests/Interop/Windows/other/d3d11on12on7 +--traverse +C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/d3d11on12on7.h diff --git a/generation/other/d3d11on12on7/header.txt b/generation/other/d3d11on12on7/header.txt new file mode 100644 index 0000000000..b5239cdbe3 --- /dev/null +++ b/generation/other/d3d11on12on7/header.txt @@ -0,0 +1,4 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. diff --git a/generation/other/d3d11on12on7/other-d3d11on12on7.h b/generation/other/d3d11on12on7/other-d3d11on12on7.h new file mode 100644 index 0000000000..f5a59e6a72 --- /dev/null +++ b/generation/other/d3d11on12on7/other-d3d11on12on7.h @@ -0,0 +1,3 @@ +#include +#include +#include diff --git a/generation/other/d3d12downlevel/generate.rsp b/generation/other/d3d12downlevel/generate.rsp new file mode 100644 index 0000000000..60c59e50c7 --- /dev/null +++ b/generation/other/d3d12downlevel/generate.rsp @@ -0,0 +1,12 @@ +@../../settings.rsp +@../../remap.rsp +--file +other-d3d12downlevel.h +--output +../../../sources/Interop/Windows/other/d3d12downlevel +--test-output +../../../tests/Interop/Windows/other/d3d12downlevel +--traverse +C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/d3d12downlevel.h +--with-librarypath +*=d3d12 \ No newline at end of file diff --git a/generation/other/d3d12downlevel/header.txt b/generation/other/d3d12downlevel/header.txt new file mode 100644 index 0000000000..5869267b6e --- /dev/null +++ b/generation/other/d3d12downlevel/header.txt @@ -0,0 +1,4 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. diff --git a/generation/other/d3d12downlevel/other-d3d12downlevel.h b/generation/other/d3d12downlevel/other-d3d12downlevel.h new file mode 100644 index 0000000000..7d7519b9bd --- /dev/null +++ b/generation/other/d3d12downlevel/other-d3d12downlevel.h @@ -0,0 +1,2 @@ +#include +#include "d3d12downlevel.h" diff --git a/generation/other/d3dx12/generate.rsp b/generation/other/d3dx12/generate.rsp index 28a6c292e6..530af9ec49 100644 --- a/generation/other/d3dx12/generate.rsp +++ b/generation/other/d3dx12/generate.rsp @@ -1,10 +1,10 @@ -@../../../settings.rsp -@../../../remap.rsp +@../../settings.rsp +@../../remap.rsp --file other-d3dx12.h --output -../../../../sources/Interop/Windows/other/d3dx12 +../../../sources/Interop/Windows/other/d3dx12 --test-output -../../../../tests/Interop/Windows/other/d3dx12 +../../../tests/Interop/Windows/other/d3dx12 --traverse d3dx12.h diff --git a/generation/other/dxcapi/generate.rsp b/generation/other/dxcapi/generate.rsp index ec9236bffd..f54502e0a6 100644 --- a/generation/other/dxcapi/generate.rsp +++ b/generation/other/dxcapi/generate.rsp @@ -1,5 +1,5 @@ -@../../../settings.rsp -@../../../remap.rsp +@../../settings.rsp +@../../remap.rsp --exclude CLSID_DxcAssembler CLSID_DxcCompiler @@ -45,9 +45,9 @@ IDxcVersionInfo2 --file other-dxcapi.h --output -../../../../sources/Interop/Windows/other/dxcapi +../../../sources/Interop/Windows/other/dxcapi --test-output -../../../../tests/Interop/Windows/other/dxcapi +../../../tests/Interop/Windows/other/dxcapi --traverse dxcapi.h --with-librarypath diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs new file mode 100644 index 0000000000..31f6f2020f --- /dev/null +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs @@ -0,0 +1,56 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using System; +using System.Runtime.CompilerServices; + +namespace TerraFX.Interop +{ + [NativeTypeName("struct ID3D11On12On7 : IUnknown")] + public unsafe partial struct ID3D11On12On7 + { + public void** lpVtbl; + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* stdcall)(lpVtbl[0]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* stdcall)(lpVtbl[1]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* stdcall)(lpVtbl[2]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + } + + public void SetThreadDeviceCreationParams([NativeTypeName("ID3D12Device *")] ID3D12Device* pDevice, [NativeTypeName("ID3D12CommandQueue *")] ID3D12CommandQueue* pGraphicsQueue) + { + ((delegate* stdcall)(lpVtbl[3]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), pDevice, pGraphicsQueue); + } + + public void SetThreadResourceCreationParams([NativeTypeName("ID3D12Resource *")] ID3D12Resource* pResource) + { + ((delegate* stdcall)(lpVtbl[4]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), pResource); + } + + [return: NativeTypeName("ID3D11On12On7Device *")] + public ID3D11On12On7Device* GetThreadLastCreatedDevice() + { + return ((delegate* stdcall)(lpVtbl[5]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ID3D11On12On7Resource *")] + public ID3D11On12On7Resource* GetThreadLastCreatedResource() + { + return ((delegate* stdcall)(lpVtbl[6]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + } + } +} diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs new file mode 100644 index 0000000000..c5ba7497ad --- /dev/null +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs @@ -0,0 +1,26 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using System.Runtime.CompilerServices; + +namespace TerraFX.Interop +{ + public unsafe partial struct ID3D11On12On7Device + { + public void** lpVtbl; + + [return: NativeTypeName("HRESULT")] + public int AcquireResource([NativeTypeName("ID3D11On12On7Resource *")] ID3D11On12On7Resource* pResource, D3D12_RESOURCE_STATES state) + { + return ((delegate* stdcall)(lpVtbl[0]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); + } + + [return: NativeTypeName("HRESULT")] + public int ReleaseResource([NativeTypeName("ID3D11On12On7Resource *")] ID3D11On12On7Resource* pResource, D3D12_RESOURCE_STATES state) + { + return ((delegate* stdcall)(lpVtbl[1]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); + } + } +} diff --git a/sources/Interop/Windows/other/d3d11on12on7/Windows.cs b/sources/Interop/Windows/other/d3d11on12on7/Windows.cs new file mode 100644 index 0000000000..15e3dccabd --- /dev/null +++ b/sources/Interop/Windows/other/d3d11on12on7/Windows.cs @@ -0,0 +1,16 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + public static unsafe partial class Windows + { + [DllImport("", ExactSpelling = true)] + [return: NativeTypeName("HRESULT")] + public static extern int GetD3D11On12On7Interface([NativeTypeName("ID3D11On12On7 **")] ID3D11On12On7** ppIface); + } +} diff --git a/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs b/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs new file mode 100644 index 0000000000..be0b976d86 --- /dev/null +++ b/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs @@ -0,0 +1,13 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +namespace TerraFX.Interop +{ + public enum D3D12_DOWNLEVEL_PRESENT_FLAGS + { + D3D12_DOWNLEVEL_PRESENT_FLAG_NONE = 0, + D3D12_DOWNLEVEL_PRESENT_FLAG_WAIT_FOR_VBLANK = (D3D12_DOWNLEVEL_PRESENT_FLAG_NONE + 1), + } +} diff --git a/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs b/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs new file mode 100644 index 0000000000..99f86f69d9 --- /dev/null +++ b/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("38A8C5EF-7CCB-4E81-914F-A6E9D072C494")] + [NativeTypeName("struct ID3D12CommandQueueDownlevel : IUnknown")] + public unsafe partial struct ID3D12CommandQueueDownlevel + { + public void** lpVtbl; + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* stdcall)(lpVtbl[0]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* stdcall)(lpVtbl[1]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* stdcall)(lpVtbl[2]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int Present([NativeTypeName("ID3D12GraphicsCommandList *")] ID3D12GraphicsCommandList* pOpenCommandList, [NativeTypeName("ID3D12Resource *")] ID3D12Resource* pSourceTex2D, [NativeTypeName("HWND")] IntPtr hWindow, D3D12_DOWNLEVEL_PRESENT_FLAGS Flags) + { + return ((delegate* stdcall)(lpVtbl[3]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this), pOpenCommandList, pSourceTex2D, hWindow, Flags); + } + } +} diff --git a/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs b/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs new file mode 100644 index 0000000000..e65ae5eeee --- /dev/null +++ b/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop +{ + [Guid("74EAEE3F-2F4B-476D-82BA-2B85CB49E310")] + [NativeTypeName("struct ID3D12DeviceDownlevel : IUnknown")] + public unsafe partial struct ID3D12DeviceDownlevel + { + public void** lpVtbl; + + [return: NativeTypeName("HRESULT")] + public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) + { + return ((delegate* stdcall)(lpVtbl[0]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* stdcall)(lpVtbl[1]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* stdcall)(lpVtbl[2]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this)); + } + + [return: NativeTypeName("HRESULT")] + public int QueryVideoMemoryInfo([NativeTypeName("UINT")] uint NodeIndex, DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup, [NativeTypeName("DXGI_QUERY_VIDEO_MEMORY_INFO *")] DXGI_QUERY_VIDEO_MEMORY_INFO* pVideoMemoryInfo) + { + return ((delegate* stdcall)(lpVtbl[3]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this), NodeIndex, MemorySegmentGroup, pVideoMemoryInfo); + } + } +} diff --git a/sources/Interop/Windows/other/d3d12downlevel/Windows.cs b/sources/Interop/Windows/other/d3d12downlevel/Windows.cs new file mode 100644 index 0000000000..3cf6da2d63 --- /dev/null +++ b/sources/Interop/Windows/other/d3d12downlevel/Windows.cs @@ -0,0 +1,18 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using System; + +namespace TerraFX.Interop +{ + public static partial class Windows + { + [NativeTypeName("const GUID")] + public static readonly Guid IID_ID3D12CommandQueueDownlevel = new Guid(0x38a8c5ef, 0x7ccb, 0x4e81, 0x91, 0x4f, 0xa6, 0xe9, 0xd0, 0x72, 0xc4, 0x94); + + [NativeTypeName("const GUID")] + public static readonly Guid IID_ID3D12DeviceDownlevel = new Guid(0x74eaee3f, 0x2f4b, 0x476d, 0x82, 0xba, 0x2b, 0x85, 0xcb, 0x49, 0xe3, 0x10); + } +} diff --git a/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs new file mode 100644 index 0000000000..2aad430c46 --- /dev/null +++ b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class ID3D11On12On7DeviceTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(ID3D11On12On7Device))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(ID3D11On12On7Device).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(ID3D11On12On7Device), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(ID3D11On12On7Device), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs new file mode 100644 index 0000000000..c553eae7e0 --- /dev/null +++ b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs @@ -0,0 +1,43 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class ID3D11On12On7Tests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(ID3D11On12On7))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(ID3D11On12On7).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(ID3D11On12On7), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(ID3D11On12On7), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs b/tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs new file mode 100644 index 0000000000..52d5eb62a2 --- /dev/null +++ b/tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class ID3D12CommandQueueDownlevelTests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(ID3D12CommandQueueDownlevel).GUID, Is.EqualTo(IID_ID3D12CommandQueueDownlevel)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(ID3D12CommandQueueDownlevel))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(ID3D12CommandQueueDownlevel).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(ID3D12CommandQueueDownlevel), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(ID3D12CommandQueueDownlevel), Is.EqualTo(4)); + } + } + } +} diff --git a/tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs b/tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs new file mode 100644 index 0000000000..68b50f3e33 --- /dev/null +++ b/tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 +// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows; + +namespace TerraFX.Interop.UnitTests +{ + /// Provides validation of the struct. + public static unsafe class ID3D12DeviceDownlevelTests + { + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(ID3D12DeviceDownlevel).GUID, Is.EqualTo(IID_ID3D12DeviceDownlevel)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(ID3D12DeviceDownlevel))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(ID3D12DeviceDownlevel).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(ID3D12DeviceDownlevel), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(ID3D12DeviceDownlevel), Is.EqualTo(4)); + } + } + } +} From 9f2a60ec1934400ff40c7b93b30fb4b38d9e37e8 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 9 Sep 2020 22:00:00 +0100 Subject: [PATCH 02/14] Update generate.rsp --- generation/other/d3d12downlevel/generate.rsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation/other/d3d12downlevel/generate.rsp b/generation/other/d3d12downlevel/generate.rsp index 60c59e50c7..c31f0a7b39 100644 --- a/generation/other/d3d12downlevel/generate.rsp +++ b/generation/other/d3d12downlevel/generate.rsp @@ -9,4 +9,4 @@ other-d3d12downlevel.h --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/d3d12downlevel.h --with-librarypath -*=d3d12 \ No newline at end of file +*=d3d12 From c35570e20814761e4cdb7f1e04db02ce79afd2e2 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 9 Sep 2020 22:33:34 +0100 Subject: [PATCH 03/14] fix res --- generation/other/d3d11on12on7/generate.rsp | 2 ++ .../Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs | 4 ++-- .../Windows/other/d3d11on12on7/ID3D11On12On7Device.cs | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/generation/other/d3d11on12on7/generate.rsp b/generation/other/d3d11on12on7/generate.rsp index bdb242474d..be86032196 100644 --- a/generation/other/d3d11on12on7/generate.rsp +++ b/generation/other/d3d11on12on7/generate.rsp @@ -8,3 +8,5 @@ other-d3d11on12on7.h ../../../tests/Interop/Windows/other/d3d11on12on7 --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/d3d11on12on7.h +--remap +ID3D11On12On7Resource*=void* \ No newline at end of file diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs index 31f6f2020f..8a98488657 100644 --- a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs @@ -48,9 +48,9 @@ public void SetThreadResourceCreationParams([NativeTypeName("ID3D12Resource *")] } [return: NativeTypeName("ID3D11On12On7Resource *")] - public ID3D11On12On7Resource* GetThreadLastCreatedResource() + public void* GetThreadLastCreatedResource() { - return ((delegate* stdcall)(lpVtbl[6]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + return ((delegate* stdcall)(lpVtbl[6]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); } } } diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs index c5ba7497ad..94bb15238f 100644 --- a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs @@ -12,15 +12,15 @@ public unsafe partial struct ID3D11On12On7Device public void** lpVtbl; [return: NativeTypeName("HRESULT")] - public int AcquireResource([NativeTypeName("ID3D11On12On7Resource *")] ID3D11On12On7Resource* pResource, D3D12_RESOURCE_STATES state) + public int AcquireResource([NativeTypeName("ID3D11On12On7Resource *")] void* pResource, D3D12_RESOURCE_STATES state) { - return ((delegate* stdcall)(lpVtbl[0]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); + return ((delegate* stdcall)(lpVtbl[0]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); } [return: NativeTypeName("HRESULT")] - public int ReleaseResource([NativeTypeName("ID3D11On12On7Resource *")] ID3D11On12On7Resource* pResource, D3D12_RESOURCE_STATES state) + public int ReleaseResource([NativeTypeName("ID3D11On12On7Resource *")] void* pResource, D3D12_RESOURCE_STATES state) { - return ((delegate* stdcall)(lpVtbl[1]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); + return ((delegate* stdcall)(lpVtbl[1]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); } } } From ffe95dbe3b0db5d33e246f172fa1f9784c69f7aa Mon Sep 17 00:00:00 2001 From: John Date: Wed, 9 Sep 2020 22:43:33 +0100 Subject: [PATCH 04/14] move --- generation/other/d3d11on12on7/generate.rsp | 2 -- generation/remap.rsp | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/generation/other/d3d11on12on7/generate.rsp b/generation/other/d3d11on12on7/generate.rsp index be86032196..bdb242474d 100644 --- a/generation/other/d3d11on12on7/generate.rsp +++ b/generation/other/d3d11on12on7/generate.rsp @@ -8,5 +8,3 @@ other-d3d11on12on7.h ../../../tests/Interop/Windows/other/d3d11on12on7 --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/d3d11on12on7.h ---remap -ID3D11On12On7Resource*=void* \ No newline at end of file diff --git a/generation/remap.rsp b/generation/remap.rsp index 7331413a4b..ff90ec447f 100644 --- a/generation/remap.rsp +++ b/generation/remap.rsp @@ -101,6 +101,7 @@ ID2D1DeviceContext4.DrawTextW=DrawText ID2D1RenderTarget.DrawTextW=DrawText ID3D10Blob=ID3DBlob ID3D11InfoQueue.GetMessageW=GetMessage +ID3D11On12On7Resource*=void* ID3D12InfoQueue.GetMessageW=GetMessage IDesktopWindowTarget**=void** IDWriteFontFace.GetGlyphIndicesW=GetGlyphIndices From 5af7d38224821fa5b28bba122179d8714788bcb4 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 10 Sep 2020 18:05:15 +0100 Subject: [PATCH 05/14] Fix issues --- generation/other/d3d11on12on7/generate.rsp | 2 +- generation/other/d3d11on12on7/header.txt | 2 +- generation/other/d3d12downlevel/generate.rsp | 4 +++- generation/other/d3d12downlevel/header.txt | 2 +- .../other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs | 3 +++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/generation/other/d3d11on12on7/generate.rsp b/generation/other/d3d11on12on7/generate.rsp index bdb242474d..2cf2e38874 100644 --- a/generation/other/d3d11on12on7/generate.rsp +++ b/generation/other/d3d11on12on7/generate.rsp @@ -7,4 +7,4 @@ other-d3d11on12on7.h --test-output ../../../tests/Interop/Windows/other/d3d11on12on7 --traverse -C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/d3d11on12on7.h +d3d11on12on7.h diff --git a/generation/other/d3d11on12on7/header.txt b/generation/other/d3d11on12on7/header.txt index b5239cdbe3..4dea4767e1 100644 --- a/generation/other/d3d11on12on7/header.txt +++ b/generation/other/d3d11on12on7/header.txt @@ -1,4 +1,4 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License diff --git a/generation/other/d3d12downlevel/generate.rsp b/generation/other/d3d12downlevel/generate.rsp index c31f0a7b39..631ac0a791 100644 --- a/generation/other/d3d12downlevel/generate.rsp +++ b/generation/other/d3d12downlevel/generate.rsp @@ -7,6 +7,8 @@ other-d3d12downlevel.h --test-output ../../../tests/Interop/Windows/other/d3d12downlevel --traverse -C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um/d3d12downlevel.h +d3d12downlevel.h --with-librarypath *=d3d12 +--with-attribute +D3D12_DOWNLEVEL_PRESENT_FLAGS=Flags \ No newline at end of file diff --git a/generation/other/d3d12downlevel/header.txt b/generation/other/d3d12downlevel/header.txt index 5869267b6e..61073fa77a 100644 --- a/generation/other/d3d12downlevel/header.txt +++ b/generation/other/d3d12downlevel/header.txt @@ -1,4 +1,4 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License diff --git a/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs b/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs index be0b976d86..0cfec984d8 100644 --- a/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs +++ b/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs @@ -3,8 +3,11 @@ // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 // Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +using System; + namespace TerraFX.Interop { + [Flags] public enum D3D12_DOWNLEVEL_PRESENT_FLAGS { D3D12_DOWNLEVEL_PRESENT_FLAG_NONE = 0, From 025d8a49135134d87b8817701ede7dafa1876e38 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 10 Sep 2020 18:10:04 +0100 Subject: [PATCH 06/14] Update headers --- generation/other/d3d11on12on7/generate.rsp | 2 ++ sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs | 2 +- .../Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs | 2 +- sources/Interop/Windows/other/d3d11on12on7/Windows.cs | 4 ++-- .../other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs | 2 +- .../other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs | 2 +- .../Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs | 2 +- sources/Interop/Windows/other/d3d12downlevel/Windows.cs | 2 +- .../Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs | 2 +- .../Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs | 2 +- .../other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs | 2 +- .../other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs | 2 +- 12 files changed, 14 insertions(+), 12 deletions(-) diff --git a/generation/other/d3d11on12on7/generate.rsp b/generation/other/d3d11on12on7/generate.rsp index 2cf2e38874..3e73ed6de0 100644 --- a/generation/other/d3d11on12on7/generate.rsp +++ b/generation/other/d3d11on12on7/generate.rsp @@ -8,3 +8,5 @@ other-d3d11on12on7.h ../../../tests/Interop/Windows/other/d3d11on12on7 --traverse d3d11on12on7.h +--with-librarypath +*=d3d11on12 \ No newline at end of file diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs index 8a98488657..9da45feeff 100644 --- a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using System; using System.Runtime.CompilerServices; diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs index 94bb15238f..74a78814b5 100644 --- a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using System.Runtime.CompilerServices; diff --git a/sources/Interop/Windows/other/d3d11on12on7/Windows.cs b/sources/Interop/Windows/other/d3d11on12on7/Windows.cs index 15e3dccabd..0d387a8ec3 100644 --- a/sources/Interop/Windows/other/d3d11on12on7/Windows.cs +++ b/sources/Interop/Windows/other/d3d11on12on7/Windows.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using System.Runtime.InteropServices; @@ -9,7 +9,7 @@ namespace TerraFX.Interop { public static unsafe partial class Windows { - [DllImport("", ExactSpelling = true)] + [DllImport("d3d11on12", ExactSpelling = true)] [return: NativeTypeName("HRESULT")] public static extern int GetD3D11On12On7Interface([NativeTypeName("ID3D11On12On7 **")] ID3D11On12On7** ppIface); } diff --git a/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs b/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs index 0cfec984d8..f29e130116 100644 --- a/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs +++ b/sources/Interop/Windows/other/d3d12downlevel/D3D12_DOWNLEVEL_PRESENT_FLAGS.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using System; diff --git a/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs b/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs index 99f86f69d9..7f7a826538 100644 --- a/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs +++ b/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using System; using System.Runtime.CompilerServices; diff --git a/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs b/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs index e65ae5eeee..ed12296354 100644 --- a/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs +++ b/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using System; using System.Runtime.CompilerServices; diff --git a/sources/Interop/Windows/other/d3d12downlevel/Windows.cs b/sources/Interop/Windows/other/d3d12downlevel/Windows.cs index 3cf6da2d63..fb13da57d1 100644 --- a/sources/Interop/Windows/other/d3d12downlevel/Windows.cs +++ b/sources/Interop/Windows/other/d3d12downlevel/Windows.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using System; diff --git a/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs index 2aad430c46..2b99c8f73c 100644 --- a/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs +++ b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7DeviceTests.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using NUnit.Framework; using System; diff --git a/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs index c553eae7e0..31532adff4 100644 --- a/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs +++ b/tests/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Tests.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d11on12on7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using NUnit.Framework; using System; diff --git a/tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs b/tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs index 52d5eb62a2..afa84ba33b 100644 --- a/tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs +++ b/tests/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevelTests.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using NUnit.Framework; using System; diff --git a/tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs b/tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs index 68b50f3e33..55a9d7c33f 100644 --- a/tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs +++ b/tests/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevelTests.cs @@ -1,7 +1,7 @@ // Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from d3d12downlevel in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0 -// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License. +// Original source is Copyright © Microsoft. All rights reserved. License details can be found here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7/1.1.0/License using NUnit.Framework; using System; From bdc2e271a0a9055baa2d90f69e5123452ae80de2 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 1 Oct 2020 11:35:41 -0700 Subject: [PATCH 07/14] Updating the issue templates. --- .github/ISSUE_TEMPLATE/bug.md | 27 +++++++++++++++++ .github/ISSUE_TEMPLATE/proposal.md | 43 ++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/regression.md | 27 +++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/proposal.md create mode 100644 .github/ISSUE_TEMPLATE/regression.md diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000000..db54f4a410 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,27 @@ +--- +name: Bug +about: " An issue for something that does not behave as expected." +title: '' +labels: bug, untriaged +assignees: '' + +--- + +#### Description (optional) + +This section should contain an expanded description of the bug, if the title is +not sufficient. + +#### Reproduction Steps + +This section should contain an ordered list of steps that can be used to +reproduce the bug. Ideally, you would include as much information about your +environment as possible to help use in determining the best fix for the issue. + +#### Expected Behavior + +This section should contain a description of the behavior that is expected. + +#### Actual Behavior + +This section should contain a description of the actual behavior being observed. diff --git a/.github/ISSUE_TEMPLATE/proposal.md b/.github/ISSUE_TEMPLATE/proposal.md new file mode 100644 index 0000000000..d734149279 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/proposal.md @@ -0,0 +1,43 @@ +--- +name: Proposal +about: " An issue that represents a proposed feature or change to the repo." +title: '' +labels: proposal, untriaged +assignees: '' + +--- + +#### Description (optional) + +This section should contain an expanded description of the proposal, if the +title is not sufficient. + +#### Rationale + +This section should contain the reasoning behind the proposal. It should include +things like "Why do we need this", "How will it improve a developers quality of +life", etc. + +#### Proposed API + +This section should contain the APIs being proposed along with a brief +description of what each API does. + +#### Drawbacks + +This should contain any drawbacks for the proposal that came up during the +discussions. + +#### Alternatives + +This should contain any alternative proposals that came up during the +discussions. + +#### Other thoughts + +This should contain any additional thoughts or footnotes on the proposal. + +#### Discussions (optional) + +This section should contain a link to all discussions related to the proposal +that have been made thus far. diff --git a/.github/ISSUE_TEMPLATE/regression.md b/.github/ISSUE_TEMPLATE/regression.md new file mode 100644 index 0000000000..899714d900 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/regression.md @@ -0,0 +1,27 @@ +--- +name: Regression +about: An issue for something that behaves differently to a past release. +title: '' +labels: regression, untriaged +assignees: '' + +--- + +#### Description (optional) + +This section should contain an expanded description of the regression, if the title is +not sufficient. + +#### Reproduction Steps + +This section should contain an ordered list of steps that can be used to +reproduce the regression. Ideally, you would include as much information about your +environment as possible to help use in determining the best fix for the issue. + +#### Expected Behavior + +This section should contain a description of the behavior that is expected. + +#### Actual Behavior + +This section should contain a description of the actual behavior being observed. From 195de7b5f1ba9bd515a9ff2fcf3f4560f6a5432b Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 1 Oct 2020 11:36:22 -0700 Subject: [PATCH 08/14] Removing the legacy docs/ISSUE_TEMPLATE.md --- docs/ISSUE_TEMPLATE.md | 105 ----------------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 docs/ISSUE_TEMPLATE.md diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md deleted file mode 100644 index 8396acd84b..0000000000 --- a/docs/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,105 +0,0 @@ -# Issue Template - -Please remove everything except for the template best matching your issue type -below. Then ensure you fill in the template, to the best of your abilities -before submitting. - -## Table of Contents - -* [Code of Conduct](#code-of-conduct) -* [Question](#question) -* [Bug](#bug) -* [Regression](#regression) -* [Idea](#idea) -* [Proposal](#proposal) - -### Code of Conduct - -TerraFX and everyone contributing (this includes issues, pull requests, the -wiki, etc) must abide by the [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md). -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at admin@terrafx.dev. - -### Question - -Questions are straightforward, just prefix your issue title with `[QUESTION]` -and state what you desire to be answered. - -### Bug - -Bugs need to be both reproducible or we need some other mechanism of being able -to debug and determine the root cause of failure. Please prefix your issue title -with `[BUG]` and fill out the following sections. - -#### Description (optional) - -This section should contain an expanded description of the bug, if the title is -not sufficient. - -#### Reproduction Steps - -This section should contain an ordered list of steps that can be used to -reproduce the bug. Ideally, you would include as much information about your -environment as possible to help use in determining the best fix for the issue. - -#### Expected Behavior - -This section should contain a description of the behavior that is expected. - -#### Actual Behavior - -This section should contain a description of the actual behavior being observed. - -### Regression - -Regressions are similar to bugs but represent functionality that worked in a -prior release but is no longer functioning as expected. Please prefix your issue -title with `[REGRESSION]` and fill out the same sections as for a [Bug](#bug). - -### Idea - -Requests would ideally always be well thought and come with a full proposal; -however, this is not always possible and sometimes you want input from others -before actually proposing something. Please prefix your issue title with -`[IDEA]` and give a brief summary of what you want. - -### Proposals - -Proposals are generally thought out and discussed ideas that are ready to be -proposed for inclusion in the project. Please prefix your issue title with -`[PROPOSAL]` and fill out the following sections. - -#### Description (optional) - -This section should contain an expanded description of the proposal, if the -title is not sufficient. - -#### Rationale - -This section should contain the reasoning behind the proposal. It should include -things like "Why do we need this", "How will it improve a developers quality of -life", etc. - -#### Proposed API - -This section should contain the APIs being proposed along with a brief -description of what each API does. - -#### Drawbacks - -This should contain any drawbacks for the proposal that came up during the -discussions. - -#### Alternatives - -This should contain any alternative proposals that came up during the -discussions. - -#### Other thoughts - -This should contain any additional thoughts or footnotes on the proposal. - -#### Discussions (optional) - -This section should contain a link to all discussions related to the proposal -that have been made thus far. From d4dcdb7ea25bce636d424381c2575dad8072e712 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 1 Oct 2020 11:37:43 -0700 Subject: [PATCH 09/14] Remove the publishGH leg in CI --- .github/workflows/ci.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75e063f53b..76aa9f0025 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,19 +103,3 @@ jobs: env: NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }} - run: dotnet nuget push ./artifacts/pkg/Release/*.nupkg --api-key AzureDevOps - publishGH: - runs-on: ubuntu-latest - if: ${{ github.event_name == 'push' }} - needs: [ windows-x64, windows-x86, linux-x64, macos-x64 ] - steps: - - uses: actions/download-artifact@v2 - with: - name: windows_release_x64 - path: ./artifacts - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - source-url: https://nuget.pkg.github.com/terrafx/index.json - env: - NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: dotnet nuget push ./artifacts/pkg/Release/*.nupkg From 3ef6b7b6e079c973a9d3fa8f2396014dfb71e5fb Mon Sep 17 00:00:00 2001 From: John Date: Fri, 2 Oct 2020 21:24:53 +0100 Subject: [PATCH 10/14] Updat fnptrs --- .../Windows/other/d3d11on12on7/ID3D11On12On7.cs | 14 +++++++------- .../other/d3d11on12on7/ID3D11On12On7Device.cs | 4 ++-- .../d3d12downlevel/ID3D12CommandQueueDownlevel.cs | 8 ++++---- .../other/d3d12downlevel/ID3D12DeviceDownlevel.cs | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs index 9da45feeff..12d2c9247d 100644 --- a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7.cs @@ -16,41 +16,41 @@ public unsafe partial struct ID3D11On12On7 [return: NativeTypeName("HRESULT")] public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) { - return ((delegate* stdcall)(lpVtbl[0]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), riid, ppvObject); + return ((delegate* unmanaged)(lpVtbl[0]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), riid, ppvObject); } [return: NativeTypeName("ULONG")] public uint AddRef() { - return ((delegate* stdcall)(lpVtbl[1]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[1]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); } [return: NativeTypeName("ULONG")] public uint Release() { - return ((delegate* stdcall)(lpVtbl[2]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[2]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); } public void SetThreadDeviceCreationParams([NativeTypeName("ID3D12Device *")] ID3D12Device* pDevice, [NativeTypeName("ID3D12CommandQueue *")] ID3D12CommandQueue* pGraphicsQueue) { - ((delegate* stdcall)(lpVtbl[3]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), pDevice, pGraphicsQueue); + ((delegate* unmanaged)(lpVtbl[3]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), pDevice, pGraphicsQueue); } public void SetThreadResourceCreationParams([NativeTypeName("ID3D12Resource *")] ID3D12Resource* pResource) { - ((delegate* stdcall)(lpVtbl[4]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), pResource); + ((delegate* unmanaged)(lpVtbl[4]))((ID3D11On12On7*)Unsafe.AsPointer(ref this), pResource); } [return: NativeTypeName("ID3D11On12On7Device *")] public ID3D11On12On7Device* GetThreadLastCreatedDevice() { - return ((delegate* stdcall)(lpVtbl[5]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[5]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); } [return: NativeTypeName("ID3D11On12On7Resource *")] public void* GetThreadLastCreatedResource() { - return ((delegate* stdcall)(lpVtbl[6]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[6]))((ID3D11On12On7*)Unsafe.AsPointer(ref this)); } } } diff --git a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs index 74a78814b5..e97eaa11d7 100644 --- a/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs +++ b/sources/Interop/Windows/other/d3d11on12on7/ID3D11On12On7Device.cs @@ -14,13 +14,13 @@ public unsafe partial struct ID3D11On12On7Device [return: NativeTypeName("HRESULT")] public int AcquireResource([NativeTypeName("ID3D11On12On7Resource *")] void* pResource, D3D12_RESOURCE_STATES state) { - return ((delegate* stdcall)(lpVtbl[0]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); + return ((delegate* unmanaged)(lpVtbl[0]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); } [return: NativeTypeName("HRESULT")] public int ReleaseResource([NativeTypeName("ID3D11On12On7Resource *")] void* pResource, D3D12_RESOURCE_STATES state) { - return ((delegate* stdcall)(lpVtbl[1]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); + return ((delegate* unmanaged)(lpVtbl[1]))((ID3D11On12On7Device*)Unsafe.AsPointer(ref this), pResource, state); } } } diff --git a/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs b/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs index 7f7a826538..bbf28c1213 100644 --- a/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs +++ b/sources/Interop/Windows/other/d3d12downlevel/ID3D12CommandQueueDownlevel.cs @@ -18,25 +18,25 @@ public unsafe partial struct ID3D12CommandQueueDownlevel [return: NativeTypeName("HRESULT")] public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) { - return ((delegate* stdcall)(lpVtbl[0]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this), riid, ppvObject); + return ((delegate* unmanaged)(lpVtbl[0]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this), riid, ppvObject); } [return: NativeTypeName("ULONG")] public uint AddRef() { - return ((delegate* stdcall)(lpVtbl[1]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[1]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this)); } [return: NativeTypeName("ULONG")] public uint Release() { - return ((delegate* stdcall)(lpVtbl[2]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[2]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this)); } [return: NativeTypeName("HRESULT")] public int Present([NativeTypeName("ID3D12GraphicsCommandList *")] ID3D12GraphicsCommandList* pOpenCommandList, [NativeTypeName("ID3D12Resource *")] ID3D12Resource* pSourceTex2D, [NativeTypeName("HWND")] IntPtr hWindow, D3D12_DOWNLEVEL_PRESENT_FLAGS Flags) { - return ((delegate* stdcall)(lpVtbl[3]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this), pOpenCommandList, pSourceTex2D, hWindow, Flags); + return ((delegate* unmanaged)(lpVtbl[3]))((ID3D12CommandQueueDownlevel*)Unsafe.AsPointer(ref this), pOpenCommandList, pSourceTex2D, hWindow, Flags); } } } diff --git a/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs b/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs index ed12296354..6fe76f2ad5 100644 --- a/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs +++ b/sources/Interop/Windows/other/d3d12downlevel/ID3D12DeviceDownlevel.cs @@ -18,25 +18,25 @@ public unsafe partial struct ID3D12DeviceDownlevel [return: NativeTypeName("HRESULT")] public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("void **")] void** ppvObject) { - return ((delegate* stdcall)(lpVtbl[0]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this), riid, ppvObject); + return ((delegate* unmanaged)(lpVtbl[0]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this), riid, ppvObject); } [return: NativeTypeName("ULONG")] public uint AddRef() { - return ((delegate* stdcall)(lpVtbl[1]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[1]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this)); } [return: NativeTypeName("ULONG")] public uint Release() { - return ((delegate* stdcall)(lpVtbl[2]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this)); + return ((delegate* unmanaged)(lpVtbl[2]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this)); } [return: NativeTypeName("HRESULT")] public int QueryVideoMemoryInfo([NativeTypeName("UINT")] uint NodeIndex, DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup, [NativeTypeName("DXGI_QUERY_VIDEO_MEMORY_INFO *")] DXGI_QUERY_VIDEO_MEMORY_INFO* pVideoMemoryInfo) { - return ((delegate* stdcall)(lpVtbl[3]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this), NodeIndex, MemorySegmentGroup, pVideoMemoryInfo); + return ((delegate* unmanaged)(lpVtbl[3]))((ID3D12DeviceDownlevel*)Unsafe.AsPointer(ref this), NodeIndex, MemorySegmentGroup, pVideoMemoryInfo); } } } From a3f19e3c1d946921146b4cfbefd3657560b6c5d0 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 14 Oct 2020 07:59:58 -0700 Subject: [PATCH 11/14] Updating to .NET 5 RC2 --- scripts/build.ps1 | 2 +- scripts/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 2604910022..d450ecae56 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -133,7 +133,7 @@ try { $DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet" Create-Directory -Path $DotNetInstallDirectory - & $DotNetInstallScript -Channel master -Version 5.0.100-rc.1.20452.10 -InstallDir $DotNetInstallDirectory -Architecture $architecture + & $DotNetInstallScript -Channel master -Version 5.0.100-rc.2.20479.15 -InstallDir $DotNetInstallDirectory -Architecture $architecture $env:PATH="$DotNetInstallDirectory;$env:PATH" } diff --git a/scripts/build.sh b/scripts/build.sh index 77c5cafeff..c5fa81106c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -204,7 +204,7 @@ if [[ ! -z "$architecture" ]]; then DotNetInstallDirectory="$ArtifactsDir/dotnet" CreateDirectory "$DotNetInstallDirectory" - . "$DotNetInstallScript" --channel master --version 5.0.100-rc.1.20452.10 --install-dir "$DotNetInstallDirectory" --architecture "$architecture" + . "$DotNetInstallScript" --channel master --version 5.0.100-rc.2.20479.15 --install-dir "$DotNetInstallDirectory" --architecture "$architecture" PATH="$DotNetInstallDirectory:$PATH:" fi From 957082ea41d0d5ba59078c0431ccb82a08512eca Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 14 Oct 2020 08:26:44 -0700 Subject: [PATCH 12/14] Removing a workaround for UnmanagedCallersOnly and setting the WinForms project to target -windows --- samples/DirectX/Shared/Win32Application.cs | 5 +---- samples/WinForms/TerraFX.Samples.WinForms.csproj | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/samples/DirectX/Shared/Win32Application.cs b/samples/DirectX/Shared/Win32Application.cs index 1219f0aa0e..6d74f82c45 100644 --- a/samples/DirectX/Shared/Win32Application.cs +++ b/samples/DirectX/Shared/Win32Application.cs @@ -36,14 +36,11 @@ public static int Run(DXSample pSample, HINSTANCE hInstance, int nCmdShow) fixed (char* lpszClassName = "DXSampleClass") fixed (char* lpWindowName = pSample.Name) { - // Requires an explicit cast until C# handles UnmanagedCallersOnly - var wndProc = (delegate* unmanaged)(delegate* managed)&WindowProc; - // Initialize the window class. var windowClass = new WNDCLASSEXW { cbSize = (uint)sizeof(WNDCLASSEXW), style = CS_HREDRAW | CS_VREDRAW, - lpfnWndProc = wndProc, + lpfnWndProc = &WindowProc, hInstance = hInstance, hCursor = LoadCursorW(IntPtr.Zero, (ushort*)IDC_ARROW), lpszClassName = (ushort*)lpszClassName diff --git a/samples/WinForms/TerraFX.Samples.WinForms.csproj b/samples/WinForms/TerraFX.Samples.WinForms.csproj index c50a5b29ec..876cf13b71 100644 --- a/samples/WinForms/TerraFX.Samples.WinForms.csproj +++ b/samples/WinForms/TerraFX.Samples.WinForms.csproj @@ -3,7 +3,7 @@ - net5.0 + net5.0-windows WinExe true From 244d3082125eb0b35bdccd3bbfbb676289f7eab8 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Wed, 21 Oct 2020 17:19:40 -0700 Subject: [PATCH 13/14] Fixingup a couple RSP files for ClangSharp 11 --- generation/um/WinBase/generate.rsp | 2 ++ generation/um/directmanipulation/generate.rsp | 2 +- .../{directmanipulation.h => um-directmanipulation.h} | 0 3 files changed, 3 insertions(+), 1 deletion(-) rename generation/um/directmanipulation/{directmanipulation.h => um-directmanipulation.h} (100%) diff --git a/generation/um/WinBase/generate.rsp b/generation/um/WinBase/generate.rsp index 6c5019b1e5..0d396b4fe1 100644 --- a/generation/um/WinBase/generate.rsp +++ b/generation/um/WinBase/generate.rsp @@ -1,5 +1,7 @@ @../../settings.rsp @../../remap.rsp +--define-macro +MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS=1 --exclude CaptureStackBackTrace DefineHandleTable diff --git a/generation/um/directmanipulation/generate.rsp b/generation/um/directmanipulation/generate.rsp index 657835f0f6..1793bd6117 100644 --- a/generation/um/directmanipulation/generate.rsp +++ b/generation/um/directmanipulation/generate.rsp @@ -1,7 +1,7 @@ @../../settings.rsp @../../remap.rsp --file -directmanipulation.h +um-directmanipulation.h --output ../../../sources/Interop/Windows/um/directmanipulation --test-output diff --git a/generation/um/directmanipulation/directmanipulation.h b/generation/um/directmanipulation/um-directmanipulation.h similarity index 100% rename from generation/um/directmanipulation/directmanipulation.h rename to generation/um/directmanipulation/um-directmanipulation.h From 933e82bf1c4a85ef3f4d7b760f1d3e1e0859e16b Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Tue, 10 Nov 2020 16:07:53 -0800 Subject: [PATCH 14/14] Upgrading to .NET 5 GA and updating the moniker to beta --- .github/workflows/ci.yml | 25 +++++++++++++++++++++---- Directory.Build.props | 4 ++-- Directory.Build.targets | 4 ++-- scripts/build.ps1 | 2 +- scripts/build.sh | 2 +- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76aa9f0025..f0743dea2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,10 +87,27 @@ jobs: ./artifacts/pkg/**/* ./artifacts/tst/**/* if-no-files-found: error - publishAz: + build-nuget: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - run: ./scripts/cibuild.cmd -configuration release -architecture x64 + shell: cmd + env: + EXCLUDE_RUN_ID_FROM_PACKAGE: true + - uses: actions/upload-artifact@v2 + with: + name: nuget + path: | + ./artifacts/bin/**/* + ./artifacts/log/**/* + ./artifacts/pkg/**/* + ./artifacts/tst/**/* + if-no-files-found: error + publish-nightlies: runs-on: ubuntu-latest if: ${{ github.event_name == 'push' }} - needs: [ windows-x64, windows-x86, linux-x64, macos-x64 ] + needs: [ windows-x64, windows-x86, linux-x64, macos-x64, build-nuget ] steps: - uses: actions/download-artifact@v2 with: @@ -98,8 +115,8 @@ jobs: path: ./artifacts - uses: actions/setup-dotnet@v1 with: - dotnet-version: '3.1.x' + dotnet-version: '5.0.x' source-url: https://pkgs.terrafx.dev/index.json env: NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }} - - run: dotnet nuget push ./artifacts/pkg/Release/*.nupkg --api-key AzureDevOps + - run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --api-key AzureDevOps diff --git a/Directory.Build.props b/Directory.Build.props index 05542286af..a9d1d4142c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -42,7 +42,7 @@ $(BaseArtifactsPath)pkg/$(Configuration)/ TerraFX.Interop.Windows 10.0.19041 - alpha + beta1 pr @@ -55,7 +55,7 @@ strict true true - preview + latest 4.3 en-US true diff --git a/Directory.Build.targets b/Directory.Build.targets index 0fe2c6c969..06fb074d85 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -19,12 +19,12 @@ true - $(Version)-$(GITHUB_RUN_ID) + $(Version)-$(GITHUB_RUN_ID) - + diff --git a/scripts/build.ps1 b/scripts/build.ps1 index d450ecae56..8b621e2eae 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -133,7 +133,7 @@ try { $DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet" Create-Directory -Path $DotNetInstallDirectory - & $DotNetInstallScript -Channel master -Version 5.0.100-rc.2.20479.15 -InstallDir $DotNetInstallDirectory -Architecture $architecture + & $DotNetInstallScript -Channel master -Version 5.0.100 -InstallDir $DotNetInstallDirectory -Architecture $architecture $env:PATH="$DotNetInstallDirectory;$env:PATH" } diff --git a/scripts/build.sh b/scripts/build.sh index c5fa81106c..4c4628b123 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -204,7 +204,7 @@ if [[ ! -z "$architecture" ]]; then DotNetInstallDirectory="$ArtifactsDir/dotnet" CreateDirectory "$DotNetInstallDirectory" - . "$DotNetInstallScript" --channel master --version 5.0.100-rc.2.20479.15 --install-dir "$DotNetInstallDirectory" --architecture "$architecture" + . "$DotNetInstallScript" --channel master --version 5.0.100 --install-dir "$DotNetInstallDirectory" --architecture "$architecture" PATH="$DotNetInstallDirectory:$PATH:" fi