ID3D11DeviceContext1::DiscardResource method (d3d11_1.h)

Discards a resource from the device context.


void DiscardResource(
  [in] ID3D11Resource *pResource


[in] pResource

Type: ID3D11Resource*

A pointer to the ID3D11Resource interface for the resource to discard. The resource must have been created with usage D3D11_USAGE_DEFAULT or D3D11_USAGE_DYNAMIC, otherwise the runtime drops the call to DiscardResource; if the debug layer is enabled, the runtime returns an error message.

Return value



DiscardResource informs the graphics processing unit (GPU) that the existing content in the resource that pResource points to is no longer needed.


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]
Target Platform Windows
Header d3d11_1.h
Library D3D11.lib

See also