PFND3DDDI_DESTROYRESOURCE callback function

The DestroyResource function releases a specified resource.

Syntax


PFND3DDDI_DESTROYRESOURCE DestroyResource;

__checkReturn HRESULT APIENTRY DestroyResource(
  _In_ HANDLE hDevice,
  _In_ HANDLE hResource
)
{ ... }

Parameters

hDevice [in]

A handle to the display device (graphics context) that is used to destroy the resource.

hResource [in]

A handle to the resource that the CreateResource or OpenResource function created.

Return value

DestroyResource returns S_OK or an appropriate error result is the resource is not released.

Remarks

After the Microsoft Direct3D runtime calls the user-mode display driver's DestroyResource function, the user-mode display driver must first flush any batched commands that depend on the resource that is being destroyed by calling the runtime's pfnRenderCb function. The driver must then call the runtime's pfnDeallocateCb function to destroy allocations that are associated with the resource.

Note   The driver's DestroyResource function is not required to call pfnDeallocateCb before returning; instead, the driver can defer allocation destruction.
 
Note   A separate DestroyResource call is not made for each surface that is part of the resource. So, if a group of surfaces is atomically created, the group is always atomically destroyed as well.
 

For more information about creating and destroying resources, see Handling Resource Creation and Destruction.

Requirements

Target platform

Desktop

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

D3dumddi.h (include D3dumddi.h)

See also

CreateResource
D3DDDI_DEVICEFUNCS
OpenResource
pfnDeallocateCb
pfnRenderCb

 

 

Send comments about this topic to Microsoft

Show: