IDXGIDevice2::OfferResources method

Allows the operating system to free the video memory of resources by discarding their content.

Syntax


HRESULT OfferResources(
  [in]  UINT NumResources,
  [in]  IDXGIResource *const *ppResources,
  [in]  DXGI_OFFER_RESOURCE_PRIORITY Priority
);

Parameters

NumResources [in]

The number of resources in the ppResources argument array.

ppResources [in]

An array of pointers to IDXGIResource interfaces for the resources to offer.

Priority [in]

A DXGI_OFFER_RESOURCE_PRIORITY-typed value that indicates how valuable data is.

Return value

OfferResources returns:

  • S_OK if resources were successfully offered
  • E_INVALIDARG if a resource in the array or the priority is invalid

Remarks

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.

Note  The user mode display driver might not immediately offer the resources that you specified in a call to OfferResources. The driver can postpone offering them until the next call to IDXGISwapChain::Present, IDXGISwapChain1::Present1, or ID3D11DeviceContext::Flush.

Platform Update for Windows 7:  The runtime validates that OfferResources is used correctly on non-shared resources but doesn't perform the intended functionality. For more info about the Platform Update for Windows 7, see Platform Update for Windows 7.

Windows Phone 8: This API is supported.

Requirements

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

DXGI1_2.h

Library

Dxgi.lib

See also

IDXGIDevice2
IDXGIDevice2::ReclaimResource

 

 

Community Additions

ADD
Show:
© 2014 Microsoft