IHolographicQuadLayerInterop interface (windows.graphics.holographic.interop.h)

The IHolographicQuadLayerInterop interface is a nano-COM interface, used to create Direct3D 12 content buffers for a HolographicQuadLayer Windows Runtime object. This is an initialization step for using Direct3D 12 with Windows Mixed Reality quad layers. It also allows your application to acquire ownership of content buffers for rendering, prior to committing them with the IHolographicQuadLayerUpdateParametersInterop interface.

Your application can use IHolographicQuadLayerInterop to initialize Direct3D 12 content buffer resources for holographic quad layers. Nano-COM allows pointers to Direct3D 12 objects to be passed directly as parameters for API calls, instead of using a Windows Runtime container object.

Your application manages its own pool of holographic content buffer resources. It can create additional buffers as needed in order to continue rendering smoothly. On most devices, this will be three or four buffers. Your application should start with at least two buffers in the pool. Your application can dynamically detect when it needs to create a new buffer by looking for failed attempts to immediately acquire buffers that were previously committed for presentation. A quad layer content buffer will continue to be presented each frame until a new buffer is committed.

A buffer created by a HolographicQuadLayer object can be used only with that object. It should be released when the HolographicQuadLayer is released, or when the Direct3D 12 device needs to be recreated—whichever happens first. The buffer must not be in the GPU pipeline when it is released—Direct3D 12 fences should be used to ensure that this condition is met prior to releasing the buffer object.

Inheritance

The IHolographicQuadLayerInterop interface inherits from the IInspectable interface.

Methods

The IHolographicQuadLayerInterop interface has these methods.

 
IHolographicQuadLayerInterop::AcquireDirect3D12BufferResource

The IHolographicQuadLayerInterop::AcquireDirect3D12BufferResource function acquires a Direct3D 12 buffer resource.
IHolographicQuadLayerInterop::AcquireDirect3D12BufferResourceWithTimeout

The IHolographicQuadLayerInterop::AcquireDirect3D12BufferResourceWithTimeout function acquires a Direct3D 12 buffer resource, with an optional timeout.
IHolographicQuadLayerInterop::CreateDirect3D12ContentBufferResource

Creates a Direct3D 12 resource for use as a content buffer for the layer.
IHolographicQuadLayerInterop::CreateDirect3D12HardwareProtectedContentBufferResource

The IHolographicQuadLayerInterop::CreateDirect3D12HardwareProtectedContentBufferResource function creates a Direct3D 12 resource content buffer for the camera.
IHolographicQuadLayerInterop::UnacquireDirect3D12BufferResource

The IHolographicQuadLayerInterop::UnacquireDirect3D12BufferResource function un-acquires a Direct3D 12 buffer resource.

Remarks

To use this interface in C++/WinRT, QueryInterface for the IHolographicQuadLayerInterop interface from the HolographicQuadLayer object.

Note that you can use the HolographicViewConfiguration API to determine the available options for buffer format.

m_quadLayer = HolographicQuadLayer{ {1024, 1024} };
winrt::com_ptr<IHolographicQuadLayerInterop> quadLayerInterop{
    m_quadLayer.as<IHolographicQuadLayerInterop>() };

// Create/acquire buffer.
if (!m_D3D12ContentBuffer[m_contentBufferIndex])
{
    D3D12_RESOURCE_DESC bufferDesc{ sourceDesc };
    bufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
    bufferDesc.SampleDesc.Count = 1;
    bufferDesc.SampleDesc.Quality = 0;
    bufferDesc.MipLevels = 1;

    winrt::check_hresult(
        quadLayerInterop->CreateDirect3D12ContentBufferResource(
            m_deviceResources->GetD3D12Device(),
            &bufferDesc,
            &m_D3D12ContentBuffer[m_contentBufferIndex]));
}

To use this interface in C++/CX, cast the HolographicQuadLayer object to IInspectable*. Then QueryInterface for the IHolographicQuadLayerInterop interface from the IInspectable pointer.

m_quadLayer = ref new HolographicQuadLayer();
Microsoft::WRL::ComPtr<IHolographicQuadLayerInterop> quadLayerInterop;
{
    Microsoft::WRL::ComPtr<IInspectable> iInspectable = reinterpret_cast<IInspectable*>(m_quadLayer);
    DX::ThrowIfFailed(iInspectable.As(&quadLayerInterop));
}

// Create/acquire buffer.
if (!m_D3D12ContentBuffer[m_contentBufferIndex])
{
    D3D12_RESOURCE_DESC bufferDesc = sourceDesc;
    bufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
    bufferDesc.SampleDesc.Count = 1;
    bufferDesc.SampleDesc.Quality = 0;
    bufferDesc.MipLevels = 1;

    DX::ThrowIfFailed(quadLayerInterop->CreateDirect3D12ContentBufferResource(
        m_deviceResources->GetD3D12Device(),
        &bufferDesc,
        &m_D3D12ContentBuffer[m_contentBufferIndex]));
}

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