Also use [MemberFunction] in handwritten CCW types

このコミットが含まれているのは:
Sergio Pedri committed 2023-11-24 15:55:23 +01:00
1 親 d1a07143aa
コミット c3c1bf0509
18ファイル変更
+183 -176

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

+8 -8
ファイルの表示
@@ -27,10 +27,10 @@ internal unsafe struct ID3D12AllocationImpl
{
void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(ID3D12AllocationImpl), sizeof(void*) * 4);
lpVtbl[0] = (delegate* unmanaged<ID3D12AllocationImpl*, Guid*, void**, int>)&QueryInterface;
lpVtbl[1] = (delegate* unmanaged<ID3D12AllocationImpl*, uint>)&AddRef;
lpVtbl[2] = (delegate* unmanaged<ID3D12AllocationImpl*, uint>)&Release;
lpVtbl[3] = (delegate* unmanaged<ID3D12AllocationImpl*, ID3D12Resource**, int>)&GetD3D12Resource;
lpVtbl[0] = (delegate* unmanaged[MemberFunction]<ID3D12AllocationImpl*, Guid*, void**, int>)&QueryInterface;
lpVtbl[1] = (delegate* unmanaged[MemberFunction]<ID3D12AllocationImpl*, uint>)&AddRef;
lpVtbl[2] = (delegate* unmanaged[MemberFunction]<ID3D12AllocationImpl*, uint>)&Release;
lpVtbl[3] = (delegate* unmanaged[MemberFunction]<ID3D12AllocationImpl*, ID3D12Resource**, int>)&GetD3D12Resource;
return lpVtbl;
}
@@ -99,7 +99,7 @@ internal unsafe struct ID3D12AllocationImpl
}
/// <inheritdoc cref="IUnknown.QueryInterface"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static int QueryInterface(ID3D12AllocationImpl* @this, Guid* riid, void** ppvObject)
{
if (ppvObject is null)
@@ -123,14 +123,14 @@ internal unsafe struct ID3D12AllocationImpl
}
/// <inheritdoc cref="IUnknown.AddRef"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static uint AddRef(ID3D12AllocationImpl* @this)
{
return (uint)Interlocked.Increment(ref @this->referenceCount);
}
/// <inheritdoc cref="IUnknown.Release"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static uint Release(ID3D12AllocationImpl* @this)
{
uint referenceCount = (uint)Interlocked.Decrement(ref @this->referenceCount);
@@ -154,7 +154,7 @@ internal unsafe struct ID3D12AllocationImpl
}
/// <inheritdoc cref="ID3D12Allocation.GetD3D12Resource"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static int GetD3D12Resource(ID3D12AllocationImpl* @this, ID3D12Resource** resource)
{
if (resource is null)
+8 -8
ファイルの表示
@@ -30,10 +30,10 @@ internal unsafe struct ID3D12MemoryAllocatorFactoryImpl
{
void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(ID3D12MemoryAllocatorFactoryImpl), sizeof(void*) * 4);
lpVtbl[0] = (delegate* unmanaged<ID3D12MemoryAllocatorFactoryImpl*, Guid*, void**, int>)&QueryInterface;
lpVtbl[1] = (delegate* unmanaged<ID3D12MemoryAllocatorFactoryImpl*, uint>)&AddRef;
lpVtbl[2] = (delegate* unmanaged<ID3D12MemoryAllocatorFactoryImpl*, uint>)&Release;
lpVtbl[3] = (delegate* unmanaged<ID3D12MemoryAllocatorFactoryImpl*, ID3D12Device*, IDXGIAdapter*, ID3D12MemoryAllocator**, int>)&CreateAllocator;
lpVtbl[0] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorFactoryImpl*, Guid*, void**, int>)&QueryInterface;
lpVtbl[1] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorFactoryImpl*, uint>)&AddRef;
lpVtbl[2] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorFactoryImpl*, uint>)&Release;
lpVtbl[3] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorFactoryImpl*, ID3D12Device*, IDXGIAdapter*, ID3D12MemoryAllocator**, int>)&CreateAllocator;
return lpVtbl;
}
@@ -115,28 +115,28 @@ internal unsafe struct ID3D12MemoryAllocatorFactoryImpl
}
/// <inheritdoc cref="IUnknown.QueryInterface"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static int QueryInterface(ID3D12MemoryAllocatorFactoryImpl* @this, Guid* riid, void** ppvObject)
{
return @this->QueryInterface(riid, ppvObject);
}
/// <inheritdoc cref="IUnknown.AddRef"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static uint AddRef(ID3D12MemoryAllocatorFactoryImpl* @this)
{
return (uint)Interlocked.Increment(ref @this->referenceCount);
}
/// <inheritdoc cref="IUnknown.Release"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static uint Release(ID3D12MemoryAllocatorFactoryImpl* @this)
{
return @this->Release();
}
/// <inheritdoc cref="ID3D12MemoryAllocator.AllocateResource"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static int CreateAllocator(
ID3D12MemoryAllocatorFactoryImpl* @this,
ID3D12Device* device,
+8 -8
ファイルの表示
@@ -30,10 +30,10 @@ internal unsafe struct ID3D12MemoryAllocatorImpl
{
void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(ID3D12MemoryAllocator), sizeof(void*) * 4);
lpVtbl[0] = (delegate* unmanaged<ID3D12MemoryAllocatorImpl*, Guid*, void**, int>)&QueryInterface;
lpVtbl[1] = (delegate* unmanaged<ID3D12MemoryAllocatorImpl*, uint>)&AddRef;
lpVtbl[2] = (delegate* unmanaged<ID3D12MemoryAllocatorImpl*, uint>)&Release;
lpVtbl[3] = (delegate* unmanaged<ID3D12MemoryAllocatorImpl*, D3D12_RESOURCE_DESC*, D3D12_HEAP_TYPE, D3D12_RESOURCE_STATES, BOOL, ID3D12Allocation**, int>)&AllocateResource;
lpVtbl[0] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorImpl*, Guid*, void**, int>)&QueryInterface;
lpVtbl[1] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorImpl*, uint>)&AddRef;
lpVtbl[2] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorImpl*, uint>)&Release;
lpVtbl[3] = (delegate* unmanaged[MemberFunction]<ID3D12MemoryAllocatorImpl*, D3D12_RESOURCE_DESC*, D3D12_HEAP_TYPE, D3D12_RESOURCE_STATES, BOOL, ID3D12Allocation**, int>)&AllocateResource;
return lpVtbl;
}
@@ -123,7 +123,7 @@ internal unsafe struct ID3D12MemoryAllocatorImpl
}
/// <inheritdoc cref="IUnknown.QueryInterface"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static int QueryInterface(ID3D12MemoryAllocatorImpl* @this, Guid* riid, void** ppvObject)
{
if (ppvObject is null)
@@ -147,21 +147,21 @@ internal unsafe struct ID3D12MemoryAllocatorImpl
}
/// <inheritdoc cref="IUnknown.AddRef"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static uint AddRef(ID3D12MemoryAllocatorImpl* @this)
{
return @this->AddRef();
}
/// <inheritdoc cref="IUnknown.Release"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static uint Release(ID3D12MemoryAllocatorImpl* @this)
{
return @this->Release();
}
/// <inheritdoc cref="ID3D12MemoryAllocator.AllocateResource"/>
[UnmanagedCallersOnly]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
private static int AllocateResource(
ID3D12MemoryAllocatorImpl* @this,
D3D12_RESOURCE_DESC* resourceDescription,