Bring back minimal DXC bindings for reflection

このコミットが含まれているのは:
Sergio Pedri committed 2023-10-18 12:08:17 +02:00
1 親 d89bade85a
コミット c7722305ca
6ファイル変更
+125 -3

検索条件に一致するファイルはありません

-3
ファイルの表示
@@ -4,9 +4,6 @@ using ComputeSharp.Core.Extensions;
using ComputeSharp.Descriptors;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#if !NET6_0_OR_GREATER
using DirectX = TerraFX.Interop.DirectX.DirectX2;
#endif
namespace ComputeSharp.Interop;
+4
ファイルの表示
@@ -208,6 +208,10 @@
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\d3dcommon\D3D_TESSELLATOR_OUTPUT_PRIMITIVE.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\d3dcommon\D3D_TESSELLATOR_PARTITIONING.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\d3dcommon\ID3DBlob.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\dxcapi\CLSID.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\dxcapi\DirectX.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\dxcapi\DxcBuffer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DirectX\um\dxcapi\IDxcUtils.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows\other\helper-types\BOOL.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows\other\helper-types\HANDLE.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows\other\helper-types\HRESULT.cs" />
+39
ファイルの表示
@@ -0,0 +1,39 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License.
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace TerraFX.Interop.Windows;
internal static partial class CLSID
{
[NativeTypeName("const GUID")]
public static ref readonly Guid CLSID_DxcLibrary
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0xAF, 0xD6, 0x45, 0x62,
0xE0, 0x66,
0xFD, 0x48,
0x80,
0xB4,
0x4D,
0x27,
0x17,
0x96,
0x74,
0x8C
};
Debug.Assert(data.Length == Unsafe.SizeOf<Guid>());
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}
}
+16
ファイルの表示
@@ -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 um/dxcapi.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License.
using System;
using System.Runtime.InteropServices;
using TerraFX.Interop.Windows;
namespace TerraFX.Interop.DirectX;
internal static unsafe partial class DirectX
{
[DllImport("dxcompiler", ExactSpelling = true)]
public static extern HRESULT DxcCreateInstance([NativeTypeName("const IID &")] Guid* rclsid, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LPVOID *")] void** ppv);
}
+17
ファイルの表示
@@ -0,0 +1,17 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License.
namespace TerraFX.Interop.DirectX;
internal unsafe partial struct DxcBuffer
{
[NativeTypeName("LPCVOID")]
public void* Ptr;
[NativeTypeName("SIZE_T")]
public nuint Size;
public uint Encoding;
}
+49
ファイルの表示
@@ -0,0 +1,49 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.20348.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;
using TerraFX.Interop.Windows;
namespace TerraFX.Interop.DirectX;
[Guid("4605C4CB-2019-492A-ADA4-65F20BB7D67F")]
[NativeTypeName("struct IDxcUtils : IUnknown")]
[NativeInheritance("IUnknown")]
internal unsafe partial struct IDxcUtils
{
public void** lpVtbl;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(0)]
public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
{
return ((delegate* unmanaged[Stdcall]<IDxcUtils*, Guid*, void**, int>)(lpVtbl[0]))((IDxcUtils*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(1)]
[return: NativeTypeName("ULONG")]
public uint AddRef()
{
return ((delegate* unmanaged[Stdcall]<IDxcUtils*, uint>)(lpVtbl[1]))((IDxcUtils*)Unsafe.AsPointer(ref this));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(2)]
[return: NativeTypeName("ULONG")]
public uint Release()
{
return ((delegate* unmanaged[Stdcall]<IDxcUtils*, uint>)(lpVtbl[2]))((IDxcUtils*)Unsafe.AsPointer(ref this));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(13)]
public HRESULT CreateReflection([NativeTypeName("const DxcBuffer *")] DxcBuffer* pData, [NativeTypeName("const IID &")] Guid* iid, void** ppvReflection)
{
return ((delegate* unmanaged[Stdcall]<IDxcUtils*, DxcBuffer*, Guid*, void**, int>)(lpVtbl[13]))((IDxcUtils*)Unsafe.AsPointer(ref this), pData, iid, ppvReflection);
}
}