Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDXGIResource interface

An IDXGIResource interface allows resource sharing and identifies the memory that a resource resides in.


The IDXGIResource interface inherits from IDXGIDeviceSubObject. IDXGIResource also has these types of members:


The IDXGIResource interface has these methods.


Get the eviction priority.


Gets the handle to a shared resource.

Note  Starting with Direct3D 11.1, we recommend not to use GetSharedHandle anymore to retrieve the handle to a shared resource. Instead, use IDXGIResource1::CreateSharedHandle to get a handle for sharing. To use IDXGIResource1::CreateSharedHandle, you must create the resource as shared and specify that it uses NT handles (that is, you set the D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag). We also recommend that you create shared resources that use NT handles so you can use CloseHandle, DuplicateHandle, and so on on those shared resources.

Get the expected resource usage.


Set the priority for evicting the resource from memory.



To find out what type of memory a resource is currently located in, use IDXGIDevice::QueryResourceResidency. To share resources between processes, use ID3D10Device::OpenSharedResource. For information about how to share resources between multiple Windows graphics APIs, including Direct3D 11, Direct2D, Direct3D 10, and Direct3D 9Ex, see Surface Sharing Between Windows Graphics APIs.

You can retrieve the IDXGIResource interface from any video memory resource that you create from a Direct3D 10 and later function. Any Direct3D object that supports ID3D10Resource or ID3D11Resource also supports IDXGIResource. For example, the Direct3D 2D texture object that you create from ID3D11Device::CreateTexture2D supports IDXGIResource. You can call QueryInterface on the 2D texture object (ID3D11Texture2D) to retrieve the IDXGIResource interface. For example, to retrieve the IDXGIResource interface from the 2D texture object, use the following code.

IDXGIResource * pDXGIResource;
hr = g_pd3dTexture2D->QueryInterface(__uuidof(IDXGIResource), (void **)&pDXGIResource);

Windows Phone 8: This API is supported.






See also

DXGI Interfaces



© 2018 Microsoft