IddCxSwapChainReleaseAndAcquireBuffer2 function (iddcx.h)

An indirect display driver calls IddCxSwapChainReleaseAndAcquireBuffer2 to release the current buffer in the swap chain and acquire a new one. A driver that supports HDR adapters must use IddCxSwapChainReleaseAndAcquireBuffer2 instead of IddCxSwapChainReleaseAndAcquireBuffer and IddCxSwapChainReleaseAndAcquireSystemBuffer.

Syntax

HRESULT IddCxSwapChainReleaseAndAcquireBuffer2(
  IDDCX_SWAPCHAIN                    SwapChainObject,
  IDARG_IN_RELEASEANDACQUIREBUFFER2  *pInArgs,
  IDARG_OUT_RELEASEANDACQUIREBUFFER2 *pOutArgs
);

Parameters

SwapChainObject

[in] The swap-chain object previously passed by the OS to the driver in a EVT_IDD_CX_MONITOR_ASSIGN_SWAPCHAIN call.

pInArgs

[in] Pointer to an IDARG_IN_RELEASEANDACQUIREBUFFER2 structure containing the input arguments for the function.

pOutArgs

[out] Pointer to an IDARG_OUT_RELEASEANDACQUIREBUFFER2 structure in which the output arguments of the function are returned.

Return value

IddCxSwapChainReleaseAndAcquireBuffer2 returns S_OK on success; otherwise it returns an appropriate error code.

Remarks

The color space of the surface passed in the IDDCX_METADATA2 struct is also passed to the driver. This is because it may change on a per frame basis and not match the color space specified when a mode was committed.

Similarly, the pixel format of the provided surface can change on a frame-by-frame basis. For example, if an HDR mode is committed on a path, this does not guarantee that every surface will be an FP16 surface.

The white level for SDR content is also included to be applied to mouse cursors.

If IDDCX_METADATA2_VALID_FLAGS_HDR10METADATA is set in IDDCX_METADATA2::ValidFlags then IDDCX_METADATA2::Hdr10FrameMetaData contains valid data. This metadata can be one of three types:

IddCxSwapChainReleaseAndAcquireBuffer2 also replaces IddCxSwapChainReleaseAndAcquireSystemBuffer. A driver that would have called IddCxSwapChainReleaseAndAcquireSystemBuffer can set IDARG_IN_RELEASEANDACQUIREBUFFER2::AcquireSystemMemoryBuffer to indicate it needs IDDCX_METADATA2::SystemBufferInfo filled in.

Version 1.10 drivers that don't report FP16 support can still call this function if it's available in the OS.

For more information about HDR support, see IddCx version 1.10 updates.

Remote HDR metadata

The OS won't pass HDR metadata to remote drivers because the HDR metadata on the client system should be used, not any generated by the server. For remote drivers IDDCX_METADATA2_VALID_FLAGS_HDR10METADATA will never be set.

Requirements

Requirement Value
Minimum supported client Windows 11, version 22H2 September Update (IddCx version 1.10)
Header iddcx.h

See also

IDARG_IN_RELEASEANDACQUIREBUFFER2

IDARG_OUT_RELEASEANDACQUIREBUFFER2

IDDCX_METADATA2