ID3D11On12Device::ReleaseWrappedResources メソッド (d3d11on12.h)

D3D 11on12 用にラップされた D3D11 リソースを解放します。

構文

void ReleaseWrappedResources(
  [in] ID3D11Resource * const *ppResources,
       UINT           NumResources
);

パラメーター

[in] ppResources

種類: ID3D11Resource*

ID3D11Resource によって定義された D3D11 リソースのセットへのポインターを指定します。

NumResources

型: UINT

リソースの数。

戻り値

なし

解説

Flush を呼び出す前にこのメソッドを呼び出して、リソース バリアを適切な "out" 状態に挿入し、"in" 状態であることが期待されることをマークします。 リソース リストが指定されていない場合は、ラップされたすべてのリソースが切り替えます。 ID3D11On12Device::AcquireWrappedResources が呼び出されるまで、これらのリソースは危険追跡で "取得されていません" としてマークされます。

このメソッドには、キー付きミューテックス リソースを指定できません。代わりに IDXGIKeyedMutex::ReleaseSync を使用してください。

11On12 デバイス経由で D2D を使用して D3D12 経由でテキストをレンダリングします。

// Render text over D3D12 using D2D via the 11On12 device.
void D3D1211on12::RenderUI()
{
    D2D1_SIZE_F rtSize = m_d2dRenderTargets[m_frameIndex]->GetSize();
    D2D1_RECT_F textRect = D2D1::RectF(0, 0, rtSize.width, rtSize.height);
    static const WCHAR text[] = L"11On12";

    // Acquire our wrapped render target resource for the current back buffer.
    m_d3d11On12Device->AcquireWrappedResources(m_wrappedBackBuffers[m_frameIndex].GetAddressOf(), 1);

    // Render text directly to the back buffer.
    m_d2dDeviceContext->SetTarget(m_d2dRenderTargets[m_frameIndex].Get());
    m_d2dDeviceContext->BeginDraw();
    m_d2dDeviceContext->SetTransform(D2D1::Matrix3x2F::Identity());
    m_d2dDeviceContext->DrawTextW(
        text,
        _countof(text) - 1,
        m_textFormat.Get(),
        &textRect,
        m_textBrush.Get()
        );
    ThrowIfFailed(m_d2dDeviceContext->EndDraw());

    // Release our wrapped render target resource. Releasing 
    // transitions the back buffer resource to the state specified
    // as the OutState when the wrapped resource was created.
    m_d3d11On12Device->ReleaseWrappedResources(m_wrappedBackBuffers[m_frameIndex].GetAddressOf(), 1);

    // Flush to submit the 11 command list to the shared command queue.
    m_d3d11DeviceContext->Flush();
}

「D3D12 リファレンス」のコード例を参照してください

要件

   
対象プラットフォーム Windows
ヘッダー d3d11on12.h
Library D3D11.lib
[DLL] D3D11.dll

関連項目

ID3D11On12Device