IddCxAdapterSetRenderAdapter function (iddcx.h)

IddCxAdapterSetRenderAdapter sets the preferred render adapter on which to render the swapchains for the specified adapter.

Syntax

void IddCxAdapterSetRenderAdapter(
  [in] IDDCX_ADAPTER                          AdapterObject,
  [in] const IDARG_IN_ADAPTERSETRENDERADAPTER *pInArgs
);

Parameters

[in] AdapterObject

Adapter object of the adapter for which the rendering adapter preference is being set.

[in] pInArgs

Pointer to an IDARG_IN_ADAPTERSETRENDERADAPTER structure containing input arguments to the function.

Return value

None

Remarks

An indirect display driver (IDD) can call IddCxAdapterSetRenderAdapter at anytime to change the preferred render adapter. The driver can use Dxgi enumeration to find the required render adapter LUID.

The OS will use the ID driver's preferred render adapter where possible. In some cases (for example, when the preferred render adapter is PnpStopped), the OS may choose a different adapter. The OS passes the actual render adapter used for a swapchain to the driver in the EVT_IDD_CX_MONITOR_ASSIGN_SWAPCHAIN callback.

IddCxAdapterSetRenderAdapter can be called at any time to change the render LUID. The OS will immediately try to use this new render adapter for all active monitors, re-creating any existing swapchains onto it. Users might see some visual glitches/artifacts as the OS re-configures the desktop composition. To avoid glitches, if the driver knows the render adapter to use at startup time, the driver should call IddCxAdapterSetRenderAdapter before adding monitors and only change it while paths are active if the user has explicitly requested it, for example via a device companion application.

IddCxAdapterSetRenderAdapter is supported for both console and remote ID adapters.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1903
Header iddcx.h

See also

IDARG_IN_ADAPTERSETRENDERADAPTER