// ------------------------------------------------------------------------------
// <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="ID3D12Resource1"]/*' />
/// <unmanaged>ID3D12Resource1</unmanaged>
[Guid("9d5e227a-4430-4161-88b3-3eca6bb16e19")]
[NativeTypeName("struct ID3D12Resource1 : ID3D12Resource")]
[NativeInheritance("ID3D12Resource")]
public unsafe partial struct ID3D12Resource1 : ID3D12Resource1.Interface, INativeGuid
{
	public static ref readonly Guid IID_ID3D12Resource1
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0x7A, 0x22, 0x5E, 0x9D,
				0x30, 0x44,
				0x61, 0x41,
				0x88,
				0xB3,
				0x3E,
				0xCA,
				0x6B,
				0xB1,
				0x6E,
				0x19
			};

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

	static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_ID3D12Resource1));

	public void** lpVtbl;

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

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

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

	/// <inheritdoc cref="ID3D12Object.GetPrivateData" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(3)]
	public HResult GetPrivateData(Guid* guid, uint* pDataSize, void* pData)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, Guid*, uint*, void*, int>)(lpVtbl[3]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), guid, pDataSize, pData);
	}

	/// <inheritdoc cref="ID3D12Object.SetPrivateData" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(4)]
	public HResult SetPrivateData(Guid* guid, uint DataSize, void* pData)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, Guid*, uint, void*, int>)(lpVtbl[4]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), guid, DataSize, pData);
	}

	/// <inheritdoc cref="ID3D12Object.SetPrivateDataInterface" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(5)]
	public HResult SetPrivateDataInterface(Guid* guid, IUnknown* pData)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, Guid*, IUnknown*, int>)(lpVtbl[5]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), guid, pData);
	}

	/// <inheritdoc cref="ID3D12Object.SetName" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(6)]
	public HResult SetName(char* Name)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, char*, int>)(lpVtbl[6]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), Name);
	}

	/// <inheritdoc cref="ID3D12DeviceChild.GetDevice" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(7)]
	public HResult GetDevice(Guid* riid, void** ppvDevice)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, Guid*, void**, int>)(lpVtbl[7]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), riid, ppvDevice);
	}

	/// <inheritdoc cref="ID3D12Resource.Map" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(8)]
	public HResult Map(uint Subresource, Range* pReadRange, void** ppData)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, uint, Range*, void**, int>)(lpVtbl[8]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), Subresource, pReadRange, ppData);
	}

	/// <inheritdoc cref="ID3D12Resource.Unmap" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(9)]
	public void Unmap(uint Subresource, Range* pWrittenRange)
	{
		((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, uint, Range*, void>)(lpVtbl[9]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), Subresource, pWrittenRange);
	}

	/// <inheritdoc cref="ID3D12Resource.GetDesc" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(10)]
	public ResourceDescription GetDesc()
	{
		ResourceDescription result;
		return *((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, ResourceDescription*, ResourceDescription*>)(lpVtbl[10]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), &result);
	}

	/// <inheritdoc cref="ID3D12Resource.GetGPUVirtualAddress" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(11)]
	public ulong GetGPUVirtualAddress()
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, ulong>)(lpVtbl[11]))((ID3D12Resource1*)Unsafe.AsPointer(ref this));
	}

	/// <inheritdoc cref="ID3D12Resource.WriteToSubresource" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(12)]
	public HResult WriteToSubresource(uint DstSubresource, Box* pDstBox, void* pSrcData, uint SrcRowPitch, uint SrcDepthPitch)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, uint, Box*, void*, uint, uint, int>)(lpVtbl[12]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), DstSubresource, pDstBox, pSrcData, SrcRowPitch, SrcDepthPitch);
	}

	/// <inheritdoc cref="ID3D12Resource.ReadFromSubresource" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(13)]
	public HResult ReadFromSubresource(void* pDstData, uint DstRowPitch, uint DstDepthPitch, uint SrcSubresource, Box* pSrcBox)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, void*, uint, uint, uint, Box*, int>)(lpVtbl[13]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), pDstData, DstRowPitch, DstDepthPitch, SrcSubresource, pSrcBox);
	}

	/// <inheritdoc cref="ID3D12Resource.GetHeapProperties" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(14)]
	public HResult GetHeapProperties(HeapProperties* pHeapProperties, HeapFlags* pHeapFlags)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, HeapProperties*, HeapFlags*, int>)(lpVtbl[14]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), pHeapProperties, pHeapFlags);
	}

	/// <include file='../Direct3D12.xml' path='doc/member[@name="ID3D12Resource1::GetProtectedResourceSession"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(15)]
	public HResult GetProtectedResourceSession(Guid* riid, void** ppProtectedSession)
	{
		return ((delegate* unmanaged[MemberFunction]<ID3D12Resource1*, Guid*, void**, int>)(lpVtbl[15]))((ID3D12Resource1*)Unsafe.AsPointer(ref this), riid, ppProtectedSession);
	}

	public interface Interface : ID3D12Resource.Interface
	{
		[VtblIndex(15)]
		HResult GetProtectedResourceSession(Guid* riid, void** ppProtectedSession);
	}
}

