IHolographicCameraInterop::AcquireDirect3D12BufferResourceWithTimeout method (windows.graphics.holographic.interop.h)

The AcquireDirect3D12BufferResourceWithTimeout method transitions ownership of a Direct3D 12 back buffer resource from the platform to your application, waiting up to the amount of time indicated by the duration argument for the resource to become available. If your application already owns control of the resource, the acquisition is considered to be a success, and the method returns immediately.

After committing a resource to a HolographicFrame by calling IHolographicQuadLayerUpdateParametersInterop::CommitDirect3D12Resource, your application should consider control of that resource to be owned by the system until such a time as it is reacquired by your application using AcquireDirect3D12BufferResourceWithTimeout. The system owns the buffer until the frame that the buffer was committed to makes its way through the presentation queue. To determine whether the system has relinquished control of the buffer, call AcquireDirect3D12BufferResource or AcquireDirect3D12BufferResourceWithTimeout. If the buffer can't be acquired by the time your application is ready to start rendering a new HolographicFrame, then you should create a new resource and add it to the buffer queue, or limit the queue size by waiting for a buffer to become available.

This method accepts an optional timeout value. When a nonzero value is present in the duration argument, the system waits for that many milliseconds for the buffer to become available. The default behavior is to not wait. When a timeout value of zero is specified and the buffer is not ready to be acquired, the method call fails with the error code E_NOTREADY.

Syntax

HRESULT AcquireDirect3D12BufferResourceWithTimeout(
  ID3D12Resource     *pResourceToAcquire,
  ID3D12CommandQueue *pCommandQueue,
  UINT64             duration
);

Parameters

pResourceToAcquire

Type: ID3D12Resource*

The Direct3D 12 resource to acquire.

pCommandQueue

Type: ID3D12CommandQueue*

The Direct3D 12 command queue to use for transitioning the state of this resource when acquiring it for your application. The resource will be in the D3D12_RESOURCE_STATE_COMMON state when it is acquired.

duration

Type: UINT64

If this parameter is set to a non-zero value, the call will wait for that amount of time for the buffer to be acquired. If the timeout period elapses before the buffer can be acquired, the method will fail with the error code E_TIMEOUT. This parameter is specified in 100-nanosecond units, similar to the TimeSpan.Duration field.

Return value

S_OK if successful, otherwise returns an HRESULT error code indicating the reason for failure. Also see COM Error Codes (UI, Audio, DirectX, Codec).

Requirements

Requirement Value
Minimum supported client Windows 10, version 2004 (10.0; Build 19041)
Minimum supported server Windows Server, version 2004 (10.0; Build 19041)
Header windows.graphics.holographic.interop.h