IHolographicQuadLayerInterop::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, then the acquisition is still 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 relinquished to the system until such a time as it is reacquired by your application using AcquireDirect3D12BufferResourceWithTimeout. The system owns the buffer until it is no longer needed for presenting the quad layer. 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 update for the quad layer, 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 non-zero 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. The resource will be in the D3D12_RESOURCE_STATE_COMMON state when it is acquired.

pCommandQueue

Type: ID3D12CommandQueue*

The Direct3D 12 command queue to use for transitioning the state of this resource when acquiring it for your application.

duration

Type: UINT64

If this parameter is set, 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 fails with the error code E_TIMEOUT. This parameter is 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).

When no timeout value is specified, if this method is called and the buffer is not ready to be acquired, the method call will fail with the error code E_NOTREADY.

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

See also

AcquireDirect3D12BufferResource