typedef struct ID3D12ResourceVtbl
{
BEGIN_INTERFACE
HRESULT(STDMETHODCALLTYPE *QueryInterface)(
ID3D12Resource *This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
ULONG(STDMETHODCALLTYPE *AddRef)(ID3D12Resource *This);
ULONG(STDMETHODCALLTYPE *Release)(ID3D12Resource *This);
HRESULT(STDMETHODCALLTYPE *GetPrivateData)(
ID3D12Resource *This,
REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT(STDMETHODCALLTYPE *SetPrivateData)(
ID3D12Resource *This,
REFGUID guid,
UINT DataSize,
_In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT(STDMETHODCALLTYPE *SetPrivateDataInterface)(
ID3D12Resource *This,
REFGUID guid,
_In_opt_ const IUnknown *pData);
HRESULT(STDMETHODCALLTYPE *SetName)(
ID3D12Resource *This,
LPCWSTR Name);
D3D12_RESOURCE_DESC(STDMETHODCALLTYPE *GetDesc)(
ID3D12Resource *This);
D3D12_GPU_VIRTUAL_ADDRESS(STDMETHODCALLTYPE *GetGPUVirtualAddress)(
ID3D12Resource *This);
HRESULT(STDMETHODCALLTYPE *Map)(
ID3D12Resource *This,
UINT Subresource,
_In_opt_ const D3D12_RANGE *pReadRange,
_Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData);
void (STDMETHODCALLTYPE *Unmap)(
ID3D12Resource *This,
UINT Subresource,
_In_opt_ const D3D12_RANGE *pWrittenRange);
HRESULT(STDMETHODCALLTYPE *WriteToSubresource)(
ID3D12Resource *This,
UINT DstSubresource,
_In_opt_ const D3D12_BOX *pDstBox,
_In_ const void *pSrcData,
UINT SrcRowPitch,
UINT SrcDepthPitch);
HRESULT(STDMETHODCALLTYPE *ReadFromSubresource)(
ID3D12Resource *This,
_Out_ void *pDstData,
UINT DstRowPitch,
UINT DstDepthPitch,
UINT SrcSubresource,
_In_opt_ const D3D12_BOX *pSrcBox);
HRESULT(STDMETHODCALLTYPE *GetHeapProperties)(
ID3D12Resource *This,
_Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties,
_Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags);
HRESULT(STDMETHODCALLTYPE *GetProtectedResourceSession)(
ID3D12Resource *This,
REFIID riid,
_COM_Outptr_opt_ void **ppProtectedSession);
END_INTERFACE
} ID3D12ResourceVtbl;
interface ID3D12Resource
{
CONST_VTBL struct ID3D12ResourceVtbl *lpVtbl;
};
这个接口包含了一系列方法,用于查询接口、增加引用计数、获取和设置私有数据、设置对象名称等。ID3D12Resource 接口提供了一系列用于管理和操作 GPU 资源的方法,包括映射、取消映射、写入、读取等。
具体的接口定义和使用方式可能会根据 DirectX 12 的版本而有所不同。
转载请注明出处:http://www.zyzy.cn/article/detail/26139/Win32 API/D3d12.h/ID3D12Resource