ResolveSharedResourceDXGI routine

The ResolveSharedResourceDXGI function informs a user-mode display driver that the ownership of a shared surface changed or that a surface is being used for GDI interoperation.

Syntax


pfnResolveSharedResource ResolveSharedResourceDXGI;

HRESULT __stdcall* ResolveSharedResourceDXGI(
  DXGI_DDI_ARG_RESOLVESHAREDRESOURCE *pResourceData
)
{ ... }

Parameters

pResourceData

A pointer to a DXGI_DDI_ARG_RESOLVESHAREDRESOURCE structure that specifies parameters for the display device and the surface that is associated with the display device.

Return value

ResolveSharedResourceDXGI returns one of the following values:

Return codeDescription
S_OK

The resource is successfully resolved.

D3DDDIERR_DEVICEREMOVED

The driver detects that the graphics adapter was removed. Therefore, the driver did not complete the operation. If the driver never notices the adapter-removal condition, the driver is not required to return this error code.

 

Remarks

The Direct3D runtime calls ResolveSharedResourceDXGI when an application calls one of the following functions:

  • IDXGIKeyedMutex::ReleaseSynch on a synchronized shared surface

  • IDXGISurface1::GetDC for a GDI interoperable surface

The runtime calls the driver's ResolveSharedResourceDXGI function every time a shared surface owner changes or when a surface is used for GDI interoperation.

The driver implements ResolveSharedResourceDXGI to appropriately manage resources for multiple GPU scenarios. Each resource might be divided across memory for multiple GPUs to render on. The driver can implement ResolveSharedResourceDXGI to remerge each resource so that the new resource owner has the merged resource. The driver must flush any partially built command buffers that might modify the resource.

Windows 7 provides the IS_DXGI1_1_BASE_FUNCTIONS macro (which is defined in the D3D10umddi.h header file) to allow the user-mode display driver to determine whether it receives a pointer to a DXGI1_1_DDI_BASE_FUNCTIONS or DXGI_DDI_BASE_FUNCTIONS structure in a call to its CreateDevice(D3D10) function. The DXGI1_1_DDI_BASE_FUNCTIONS structure includes the pfnResolveSharedResource member that the driver can fill with a pointer to its ResolveSharedResourceDXGI function. If IS_DXGI1_1_BASE_FUNCTIONS returns TRUE, the driver expects to receive a pointer to a DXGI1_1_DDI_BASE_FUNCTIONS structure in the pDXGIDDIBaseFunctions member of the DXGI_DDI_BASE_ARGS structure that the DXGIBaseDDI member of the D3D10DDIARG_CREATEDEVICE structure specifies. Otherwise, if IS_DXGI1_1_BASE_FUNCTIONS returns FALSE, the driver expects to receive a pointer to a DXGI_DDI_BASE_FUNCTIONS structure. Windows 7 provides the IS_DXGI1_1_BASE_FUNCTIONS macro to allow newer version drivers to work on older version runtimes. The drivers can then determine whether they will corrupt memory if they attempt to fill the pfnResolveSharedResource member of DXGI1_1_DDI_BASE_FUNCTIONS with a pointer to the ResolveSharedResourceDXGI function.

Requirements

Version

ResolveSharedResourceDXGI is supported beginning with the Windows 7 operating system.

Header

Dxgiddi.h (include D3d10umddi.h)

See also

CreateDevice(D3D10)
D3D10DDIARG_CREATEDEVICE
DXGI_DDI_ARG_RESOLVESHAREDRESOURCE
DXGI_DDI_BASE_ARGS
DXGI_DDI_BASE_FUNCTIONS
DXGI1_1_DDI_BASE_FUNCTIONS
ResolveSharedResource

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft