Skip to content

Commit d23a01c

Browse files
committed
Finish Usage Update Fixes + misc updates
-allowed for multiple COM base types -allowed for addition of manual COM types -added several manual overrides -added all manual files necessary for compilation
1 parent 8d81b80 commit d23a01c

File tree

211 files changed

+86532
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+86532
-37
lines changed

generator.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@
2323
"sources/Windows/um/httpserv/IHttpTraceContext.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/um/httpserv/IHttpTraceContext.cs",
2424
"sources/Windows/um/httpserv/CHttpModule.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/um/httpserv/CHttpModule.cs",
2525
"sources/Windows/um/icm/Windows.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/um/icm/Windows.cs",
26+
"sources/Windows/um/winioctl/TXFS_READ_BACKUP_INFORMATION_OUT.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/um/winioctl/TXFS_READ_BACKUP_INFORMATION_OUT.cs",
27+
"sources/Windows/um/winioctl/STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/um/winioctl/STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE.cs",
2628
"sources/Windows/um/WinUser/Windows.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/um/WinUser/Windows.cs",
2729
"sources/Windows/shared/strsafe/Windows.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/shared/strsafe/Windows.cs",
2830
"sources/Windows/shared/hidpi/Windows.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/shared/hidpi/Windows.cs",
31+
"sources/Windows/shared/ws2ipdef/Windows.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/shared/ws2ipdef/Windows.cs",
32+
"sources/Windows/shared/Iprtrmib/MIB_OPAQUE_INFO.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Windows/shared/Iprtrmib/MIB_OPAQUE_INFO.cs",
2933
"sources/Gdiplus/um/gdiplustypes/GpRect.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Gdiplus/um/gdiplustypes/GpRect.cs",
3034
"sources/Gdiplus/um/gdiplustypes/GpRectF.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Gdiplus/um/gdiplustypes/GpRectF.cs",
3135
"sources/Gdiplus/um/gdiplustypes/GpPathData.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Gdiplus/um/gdiplustypes/GpPathData.cs",
32-
"sources/Winrt/winrt/windows.security.authentication.web.core/IID.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Winrt/winrt/windows.security.authentication.web.core/IID.Manual.cs",
33-
"sources/Winrt/winrt/windows.ui.input/IID.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/Winrt/winrt/windows.ui.input/IID.Manual.cs"
36+
"sources/WinRT/winrt/windows.perception.spatial/ISpatialCoordinateSystem.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/WinRT/winrt/windows.perception.spatial/ISpatialCoordinateSystem.cs",
37+
"sources/WinRT/winrt/windows.security.authentication.web.core/IID.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/WinRT/winrt/windows.security.authentication.web.core/IID.Manual.cs",
38+
"sources/WinRT/winrt/windows.ui.input/IID.gen.cs": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows/WinRT/winrt/windows.ui.input/IID.Manual.cs"
3439
},
3540
"InputSourceRoot": "eng/submodules/terrafx.interop.windows/sources/Interop/Windows",
3641
"InputTestRoot": "eng/submodules/terrafx.interop.windows/tests/Interop/Windows",
@@ -45,7 +50,9 @@
4550
}
4651
},
4752
"TransformCOM": {
48-
"BaseType": "IUnknown.Interface"
53+
"BaseTypes": [
54+
"IUnknown.Interface"
55+
]
4956
}
5057
},
5158
"SDL": {

sources/SilkTouch/SilkTouch/Mods/TransformCOM.cs

Lines changed: 180 additions & 34 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
2+
3+
// Ported from D3D11On12On7.h in the https://www.nuget.org/packages/Microsoft.Direct3D.D3D12On7 nuget package, version 1.1.0
4+
// 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
5+
6+
using System;
7+
using System.Diagnostics;
8+
using System.Runtime.CompilerServices;
9+
using System.Runtime.InteropServices;
10+
11+
namespace Silk.NET.Windows;
12+
13+
public static partial class IID
14+
{
15+
public static ref readonly Guid IID_ID3D11On12On7
16+
{
17+
get
18+
{
19+
ReadOnlySpan<byte> data = [
20+
0x00, 0x00, 0x00, 0x00,
21+
0x00, 0x00,
22+
0x00, 0x00,
23+
0x00,
24+
0x00,
25+
0x00,
26+
0x00,
27+
0x00,
28+
0x00,
29+
0x00,
30+
0x00
31+
];
32+
33+
Debug.Assert(data.Length == Unsafe.SizeOf<Guid>());
34+
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
35+
}
36+
}
37+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
2+
3+
// Ported from d3dx12_core.h in microsoft/DirectX-Headers tag v1.614.0
4+
// Original source is Copyright © Microsoft. Licensed under the MIT license
5+
6+
using System;
7+
using System.Diagnostics.CodeAnalysis;
8+
using static Silk.NET.DirectX.D3D12_RESOURCE_DIMENSION;
9+
using static Silk.NET.DirectX.D3D12_RESOURCE_FLAGS;
10+
using static Silk.NET.DirectX.D3D12_TEXTURE_LAYOUT;
11+
using static Silk.NET.DirectX.DXGI_FORMAT;
12+
13+
namespace Silk.NET.DirectX;
14+
15+
public unsafe partial struct D3D12_RESOURCE_DESC : IEquatable<D3D12_RESOURCE_DESC>
16+
{
17+
/// <include file='DirectX.xml' path='doc/member[@name="DirectX.Equals"]/*' />
18+
public static bool operator ==([NativeTypeName("const D3D12_RESOURCE_DESC &")] in D3D12_RESOURCE_DESC l, [NativeTypeName("const D3D12_RESOURCE_DESC &")] in D3D12_RESOURCE_DESC r)
19+
=> (l.Dimension == r.Dimension)
20+
&& (l.Alignment == r.Alignment)
21+
&& (l.Width == r.Width)
22+
&& (l.Height == r.Height)
23+
&& (l.DepthOrArraySize == r.DepthOrArraySize)
24+
&& (l.MipLevels == r.MipLevels)
25+
&& (l.Format == r.Format)
26+
&& (l.SampleDesc.Count == r.SampleDesc.Count)
27+
&& (l.SampleDesc.Quality == r.SampleDesc.Quality)
28+
&& (l.Layout == r.Layout)
29+
&& (l.Flags == r.Flags);
30+
31+
/// <include file='DirectX.xml' path='doc/member[@name="DirectX.NotEquals"]/*' />
32+
public static bool operator !=([NativeTypeName("const D3D12_RESOURCE_DESC &")] in D3D12_RESOURCE_DESC l, [NativeTypeName("const D3D12_RESOURCE_DESC &")] in D3D12_RESOURCE_DESC r)
33+
=> !(l == r);
34+
35+
public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is D3D12_RESOURCE_DESC other) && Equals(other);
36+
37+
public readonly bool Equals(D3D12_RESOURCE_DESC other) => (this == other);
38+
39+
public override readonly int GetHashCode()
40+
{
41+
var hashCode = new HashCode();
42+
43+
hashCode.Add(Dimension);
44+
hashCode.Add(Alignment);
45+
hashCode.Add(Width);
46+
hashCode.Add(Height);
47+
hashCode.Add(DepthOrArraySize);
48+
hashCode.Add(MipLevels);
49+
hashCode.Add(Format);
50+
hashCode.Add(SampleDesc.Count);
51+
hashCode.Add(SampleDesc.Quality);
52+
hashCode.Add(Layout);
53+
hashCode.Add(Flags);
54+
55+
return hashCode.ToHashCode();
56+
}
57+
58+
[return: NativeTypeName("CD3DX12_RESOURCE_DESC")]
59+
public static D3D12_RESOURCE_DESC Buffer([NativeTypeName("const D3D12_RESOURCE_ALLOCATION_INFO &")] in D3D12_RESOURCE_ALLOCATION_INFO resAllocInfo, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE)
60+
{
61+
return new D3D12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags);
62+
}
63+
64+
[return: NativeTypeName("UINT16")]
65+
public readonly ushort Depth()
66+
{
67+
return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : (ushort)(1));
68+
}
69+
70+
[return: NativeTypeName("UINT16")]
71+
public readonly ushort ArraySize()
72+
{
73+
return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : (ushort)(1));
74+
}
75+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
2+
3+
// Ported from d3dx12_core.h in microsoft/DirectX-Headers tag v1.614.0
4+
// Original source is Copyright © Microsoft. Licensed under the MIT license
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
using System;
8+
using static Silk.NET.DirectX.D3D12_RESOURCE_DIMENSION;
9+
using static Silk.NET.DirectX.D3D12_RESOURCE_FLAGS;
10+
using static Silk.NET.DirectX.D3D12_TEXTURE_LAYOUT;
11+
using static Silk.NET.DirectX.DXGI_FORMAT;
12+
13+
namespace Silk.NET.DirectX;
14+
15+
public unsafe partial struct D3D12_RESOURCE_DESC1 : IEquatable<D3D12_RESOURCE_DESC1>
16+
{
17+
/// <include file='DirectX.xml' path='doc/member[@name="DirectX.Equals"]/*' />
18+
public static bool operator ==([NativeTypeName("const D3D12_RESOURCE_DESC1 &")] in D3D12_RESOURCE_DESC1 l, [NativeTypeName("const D3D12_RESOURCE_DESC1 &")] in D3D12_RESOURCE_DESC1 r)
19+
=> (l.Dimension == r.Dimension)
20+
&& (l.Alignment == r.Alignment)
21+
&& (l.Width == r.Width)
22+
&& (l.Height == r.Height)
23+
&& (l.DepthOrArraySize == r.DepthOrArraySize)
24+
&& (l.MipLevels == r.MipLevels)
25+
&& (l.Format == r.Format)
26+
&& (l.SampleDesc.Count == r.SampleDesc.Count)
27+
&& (l.SampleDesc.Quality == r.SampleDesc.Quality)
28+
&& (l.Layout == r.Layout)
29+
&& (l.Flags == r.Flags)
30+
&& (l.SamplerFeedbackMipRegion.Width == r.SamplerFeedbackMipRegion.Width)
31+
&& (l.SamplerFeedbackMipRegion.Height == r.SamplerFeedbackMipRegion.Height)
32+
&& (l.SamplerFeedbackMipRegion.Depth == r.SamplerFeedbackMipRegion.Depth);
33+
34+
/// <include file='DirectX.xml' path='doc/member[@name="DirectX.NotEquals"]/*' />
35+
public static bool operator !=([NativeTypeName("const D3D12_RESOURCE_DESC1 &")] in D3D12_RESOURCE_DESC1 l, [NativeTypeName("const D3D12_RESOURCE_DESC1 &")] in D3D12_RESOURCE_DESC1 r)
36+
=> !(l == r);
37+
38+
public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is D3D12_RESOURCE_DESC1 other) && Equals(other);
39+
40+
public readonly bool Equals(D3D12_RESOURCE_DESC1 other) => (this == other);
41+
42+
public override readonly int GetHashCode()
43+
{
44+
var hashCode = new HashCode();
45+
46+
hashCode.Add(Dimension);
47+
hashCode.Add(Alignment);
48+
hashCode.Add(Width);
49+
hashCode.Add(Height);
50+
hashCode.Add(DepthOrArraySize);
51+
hashCode.Add(MipLevels);
52+
hashCode.Add(Format);
53+
hashCode.Add(SampleDesc.Count);
54+
hashCode.Add(SampleDesc.Quality);
55+
hashCode.Add(Layout);
56+
hashCode.Add(Flags);
57+
hashCode.Add(SamplerFeedbackMipRegion.Width);
58+
hashCode.Add(SamplerFeedbackMipRegion.Height);
59+
hashCode.Add(SamplerFeedbackMipRegion.Depth);
60+
61+
return hashCode.ToHashCode();
62+
}
63+
64+
public D3D12_RESOURCE_DESC1([NativeTypeName("const D3D12_RESOURCE_DESC &")] in D3D12_RESOURCE_DESC o)
65+
{
66+
Dimension = o.Dimension;
67+
Alignment = o.Alignment;
68+
Width = o.Width;
69+
Height = o.Height;
70+
DepthOrArraySize = o.DepthOrArraySize;
71+
MipLevels = o.MipLevels;
72+
Format = o.Format;
73+
SampleDesc = o.SampleDesc;
74+
Layout = o.Layout;
75+
Flags = o.Flags;
76+
SamplerFeedbackMipRegion = new D3D12_MIP_REGION {
77+
};
78+
}
79+
80+
[return: NativeTypeName("CD3DX12_RESOURCE_DESC1")]
81+
public static D3D12_RESOURCE_DESC1 Buffer([NativeTypeName("const D3D12_RESOURCE_ALLOCATION_INFO &")] in D3D12_RESOURCE_ALLOCATION_INFO resAllocInfo, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE)
82+
{
83+
return new D3D12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags, 0, 0, 0);
84+
}
85+
86+
[return: NativeTypeName("UINT16")]
87+
public readonly ushort Depth()
88+
{
89+
return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : (ushort)(1));
90+
}
91+
92+
[return: NativeTypeName("UINT16")]
93+
public readonly ushort ArraySize()
94+
{
95+
return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : (ushort)(1));
96+
}
97+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
2+
3+
// Ported from d3dx12_core.h in microsoft/DirectX-Headers tag v1.614.0
4+
// Original source is Copyright © Microsoft. Licensed under the MIT license
5+
6+
using System.Runtime.CompilerServices;
7+
using static Silk.NET.DirectX.D3D12;
8+
using static Silk.NET.DirectX.D3D12_RESOURCE_DIMENSION;
9+
using static Silk.NET.DirectX.D3D12_TEXTURE_LAYOUT;
10+
11+
namespace Silk.NET.DirectX;
12+
13+
public static unsafe partial class DirectX
14+
{
15+
public static ID3D12CommandList* CommandListCast<t_CommandListType>(t_CommandListType* pp)
16+
where t_CommandListType : unmanaged, ID3D12CommandList.Interface
17+
{
18+
return (ID3D12CommandList*)(pp);
19+
}
20+
21+
[return: NativeTypeName("const CD3DX12_RESOURCE_DESC1 *")]
22+
public static ref readonly D3D12_RESOURCE_DESC1 D3DX12ConditionallyExpandAPIDesc([NativeTypeName("CD3DX12_RESOURCE_DESC1 &")] ref D3D12_RESOURCE_DESC1 LclDesc, [NativeTypeName("const CD3DX12_RESOURCE_DESC1 *")] in D3D12_RESOURCE_DESC1 pDesc)
23+
{
24+
if ((pDesc.MipLevels == 0) || (pDesc.Alignment == 0))
25+
{
26+
LclDesc = pDesc;
27+
28+
if (pDesc.MipLevels == 0)
29+
{
30+
ulong uiMaxDimension = ulong.Max((LclDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) ? LclDesc.DepthOrArraySize : 1UL, ulong.Max(LclDesc.Width, LclDesc.Height));
31+
32+
ushort uiRet = 0;
33+
34+
while (uiMaxDimension > 0)
35+
{
36+
uiRet++;
37+
uiMaxDimension >>= 1;
38+
}
39+
40+
LclDesc.MipLevels = uiRet;
41+
}
42+
43+
if (pDesc.Alignment == 0)
44+
{
45+
if ((pDesc.Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE) || (pDesc.Layout == D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE))
46+
{
47+
LclDesc.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
48+
}
49+
else
50+
{
51+
LclDesc.Alignment = (pDesc.SampleDesc.Count > 1) ? (ulong)(D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT) : (ulong)(D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT);
52+
}
53+
}
54+
55+
return ref LclDesc;
56+
}
57+
else
58+
{
59+
return ref pDesc;
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)