diff --git a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems b/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems index 11abcfc6..ee329928 100644 --- a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems +++ b/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems @@ -48,6 +48,7 @@ + diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs new file mode 100644 index 00000000..6887af76 --- /dev/null +++ b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs @@ -0,0 +1,24 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/d3dcompiler.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; + +namespace ComputeSharp.Win32; + +[Flags] +internal enum D3DCOMPILER_STRIP_FLAGS +{ + D3DCOMPILER_STRIP_REFLECTION_DATA = 0x00000001, + + D3DCOMPILER_STRIP_DEBUG_INFO = 0x00000002, + + D3DCOMPILER_STRIP_TEST_BLOBS = 0x00000004, + + D3DCOMPILER_STRIP_PRIVATE_DATA = 0x00000008, + + D3DCOMPILER_STRIP_ROOT_SIGNATURE = 0x00000010, + + D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff, +} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs index 9d7f46da..ed495995 100644 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs +++ b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs @@ -18,4 +18,7 @@ internal static unsafe partial class DirectX [DllImport("d3dcompiler_47", ExactSpelling = true)] public static extern HRESULT D3DSetBlobPart([NativeTypeName("LPCVOID")] void* pSrcData, [NativeTypeName("SIZE_T")] nuint SrcDataSize, D3D_BLOB_PART Part, uint Flags, [NativeTypeName("LPCVOID")] void* pPart, [NativeTypeName("SIZE_T")] nuint PartSize, ID3DBlob** ppNewShader); + + [DllImport("d3dcompiler_47", ExactSpelling = true)] + public static extern HRESULT D3DStripShader([NativeTypeName("LPCVOID")] void* pShaderBytecode, [NativeTypeName("SIZE_T")] nuint BytecodeLength, uint uStripFlags, ID3DBlob** ppStrippedBlob); } \ No newline at end of file