IDXGIDevice2::OfferResources method (dxgi1_2.h)
Allows the operating system to free the video memory of resources by discarding their content.
HRESULT OfferResources( [in] UINT NumResources, [in] IDXGIResource * const *ppResources, [in] DXGI_OFFER_RESOURCE_PRIORITY Priority );
The number of resources in the ppResources argument array.
An array of pointers to IDXGIResource interfaces for the resources to offer.
A DXGI_OFFER_RESOURCE_PRIORITY-typed value that indicates how valuable data is.
- S_OK if resources were successfully offered
- E_INVALIDARG if a resource in the array or the priority is invalid
The priority value that the Priority parameter specifies describes how valuable the caller considers the content to be. The operating system uses the priority value to discard resources in order of priority. The operating system discards a resource that is offered with low priority before it discards a resource that is offered with a higher priority.
If you call OfferResources to offer a resource while the resource is bound to the pipeline, the resource is unbound. You cannot call OfferResources on a resource that is mapped. After you offer a resource, the resource cannot be mapped or bound to the pipeline until you call the IDXGIDevice2::ReclaimResource method to reclaim the resource. You cannot call OfferResources to offer immutable resources.
To offer shared resources, call OfferResources on only one of the sharing devices. To ensure exclusive access to the resources, you must use an IDXGIKeyedMutex object and then call OfferResources only while you hold the mutex. In fact, you can't offer shared resources unless you use IDXGIKeyedMutex because offering shared resources without using IDXGIKeyedMutex isn't supported.
|Minimum supported client||Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]|