SetRenderTargets
TOC
Collapse the table of content
Expand the table of content

SetRenderTargets routine

The SetRenderTargets function sets render target surfaces.

Syntax


PFND3D10DDI_SETRENDERTARGETS SetRenderTargets;

VOID APIENTRY SetRenderTargets(
  _In_       D3D10DDI_HDEVICE           hDevice,
  _In_ const D3D10DDI_HRENDERTARGETVIEW *phRenderTargetView,
  _In_       UINT                       RTargets,
  _In_       UINT                       ClearTargets,
  _In_       D3D10DDI_HDEPTHSTENCILVIEW hDepthStencilView
)
{ ... }

Parameters

hDevice [in]

A handle to the display device (graphics context).

phRenderTargetView [in]

An array of handles to the render target view objects to set. Note that some handle values can be NULL.

RTargets [in]

The number of elements in the array that phRenderTargetView specifies.

ClearTargets [in]

The number of render target slots after the number of slots that RTargets specifies to be set to NULL. This number represents the difference between the previous number of render target view objects (that is, when the Microsoft Direct3D runtime previously called SetRenderTargets) and the new number of render target view objects.

Note that the number that ClearTargets specifies is only an optimization aid because the user-mode display driver could calculate this number.

hDepthStencilView [in]

A handle to the depth stencil buffer to set.

Return value

None

The driver can use the pfnSetErrorCb callback function to set an error code. For more information about setting error codes, see the following Remarks section.

Remarks

The user-mode display driver must set all render target surfaces and the depth stencil buffer atomically as one operation.

Although the RTargets parameter specifies the number of handles in the array that the phRenderTargetView parameter specifies, some handle values in the array can be NULL.

The range of render target surfaces between the number that RTargets specifies and the maximum number of render target surfaces that are allowed is required to contain all NULL or unbound values. The number that the ClearTargets parameter specifies informs the driver about how many bind points the driver must clear out for the current atomic operation.

If the previous call to SetRenderTargets passed a value of 2 in the RTargets parameter and the current call to SetRenderTargets passes a value of 4 in RTargets, the current call to SetRenderTargets also passes a value of 0 in the ClearTargets parameter. If the next successive call to SetRenderTargets passes a value of 1 in RTargets, the successive call also passes a value of 3 (4 - 1) in ClearTargets.

When the value of clear targets is requested during user-mode query operations, the value is the difference between the maximum number of render target surfaces and the render targets value.

The driver should not encounter any error, except for D3DDDIERR_DEVICEREMOVED. Therefore, if the driver passes any error, except for D3DDDIERR_DEVICEREMOVED, in a call to the pfnSetErrorCb function, the Microsoft Direct3D runtime will determine that the error is critical. Even if the device was removed, the driver is not required to return D3DDDIERR_DEVICEREMOVED; however, if device removal interfered with the operation of SetRenderTargets (which typically should not happen), the driver can return D3DDDIERR_DEVICEREMOVED.

Requirements

Target platform

Version

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

Header

D3d10umddi.h (include D3d10umddi.h)

See also

D3D10DDI_DEVICEFUNCS
pfnSetErrorCb

 

 

Send comments about this topic to Microsoft

Show:
© 2016 Microsoft