// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

namespace Win32.Graphics.Direct3D12;

/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory"]/*' />
/// <unmanaged>ID3D12DeviceFactory</unmanaged>
[Guid("61f307d3-d34e-4e7c-8374-3ba4de23cccb")]
[NativeTypeName("struct ID3D12DeviceFactory : IUnknown")]
[NativeInheritance("IUnknown")]
public unsafe partial struct ID3D12DeviceFactory : ID3D12DeviceFactory.Interface, INativeGuid
{
	public static ref readonly Guid IID_ID3D12DeviceFactory
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0xD3, 0x07, 0xF3, 0x61,
				0x4E, 0xD3,
				0x7C, 0x4E,
				0x83,
				0x74,
				0x3B,
				0xA4,
				0xDE,
				0x23,
				0xCC,
				0xCB
			};

			Debug.Assert(data.Length == Unsafe.SizeOf<Guid>());
			return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
		}
	}

#if NET6_0_OR_GREATER
	static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_ID3D12DeviceFactory));
#else
	public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_ID3D12DeviceFactory));
#endif

	public void** lpVtbl;

	/// <inheritdoc cref="IUnknown.QueryInterface" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(0)]
	public HResult QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, Guid*, void**, int>)(lpVtbl[0]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), riid, ppvObject);
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, Guid*, void**, int>)(lpVtbl[0]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), riid, ppvObject);
#endif
	}

	/// <inheritdoc cref="IUnknown.AddRef" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(1)]
	[return: NativeTypeName("ULONG")]
	public uint AddRef()
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, uint>)(lpVtbl[1]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, uint>)(lpVtbl[1]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#endif
	}

	/// <inheritdoc cref="IUnknown.Release" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(2)]
	[return: NativeTypeName("ULONG")]
	public uint Release()
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, uint>)(lpVtbl[2]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, uint>)(lpVtbl[2]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#endif
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory::InitializeFromGlobalState"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(3)]
	public HResult InitializeFromGlobalState()
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, int>)(lpVtbl[3]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, int>)(lpVtbl[3]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#endif
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory::ApplyToGlobalState"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(4)]
	public HResult ApplyToGlobalState()
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, int>)(lpVtbl[4]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, int>)(lpVtbl[4]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#endif
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory::SetFlags"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(5)]
	public HResult SetFlags(DeviceFactoryFlags flags)
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, DeviceFactoryFlags, int>)(lpVtbl[5]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), flags);
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, DeviceFactoryFlags, int>)(lpVtbl[5]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), flags);
#endif
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory::GetFlags"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(6)]
	public DeviceFactoryFlags GetFlags()
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, DeviceFactoryFlags>)(lpVtbl[6]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, DeviceFactoryFlags>)(lpVtbl[6]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this));
#endif
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory::GetConfigurationInterface"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(7)]
	public HResult GetConfigurationInterface(Guid* clsid, Guid* iid, void** ppv)
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, Guid*, Guid*, void**, int>)(lpVtbl[7]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), clsid, iid, ppv);
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, Guid*, Guid*, void**, int>)(lpVtbl[7]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), clsid, iid, ppv);
#endif
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory::EnableExperimentalFeatures"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(8)]
	public HResult EnableExperimentalFeatures(uint NumFeatures, Guid* pIIDs, void* pConfigurationStructs, uint* pConfigurationStructSizes)
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, uint, Guid*, void*, uint*, int>)(lpVtbl[8]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), NumFeatures, pIIDs, pConfigurationStructs, pConfigurationStructSizes);
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, uint, Guid*, void*, uint*, int>)(lpVtbl[8]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), NumFeatures, pIIDs, pConfigurationStructs, pConfigurationStructSizes);
#endif
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12DeviceFactory::CreateDevice"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(9)]
	public HResult CreateDevice(IUnknown* adapter, Graphics.Direct3D.FeatureLevel FeatureLevel, Guid* riid, void** ppvDevice)
	{
#if NET6_0_OR_GREATER
		return ((delegate* unmanaged<ID3D12DeviceFactory*, IUnknown*, Graphics.Direct3D.FeatureLevel, Guid*, void**, int>)(lpVtbl[9]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), adapter, FeatureLevel, riid, ppvDevice);
#else
		return ((delegate* unmanaged[Stdcall]<ID3D12DeviceFactory*, IUnknown*, Graphics.Direct3D.FeatureLevel, Guid*, void**, int>)(lpVtbl[9]))((ID3D12DeviceFactory*)Unsafe.AsPointer(ref this), adapter, FeatureLevel, riid, ppvDevice);
#endif
	}

	public interface Interface : IUnknown.Interface
	{
		[VtblIndex(3)]
		HResult InitializeFromGlobalState();

		[VtblIndex(4)]
		HResult ApplyToGlobalState();

		[VtblIndex(5)]
		HResult SetFlags(DeviceFactoryFlags flags);

		[VtblIndex(6)]
		DeviceFactoryFlags GetFlags();

		[VtblIndex(7)]
		HResult GetConfigurationInterface(Guid* clsid, Guid* iid, void** ppv);

		[VtblIndex(8)]
		HResult EnableExperimentalFeatures(uint NumFeatures, Guid* pIIDs, void* pConfigurationStructs, uint* pConfigurationStructSizes);

		[VtblIndex(9)]
		HResult CreateDevice(IUnknown* adapter, Graphics.Direct3D.FeatureLevel FeatureLevel, Guid* riid, void** ppvDevice);
	}
}

