XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

DirectX10 SwapChain Shared Resource

Last post 21/10/2009 3:50 by legalize. 1 replies.
  • 28/09/2009 20:47

    DirectX10 SwapChain Shared Resource

    I have a need to have create a swapchain with the usage flag DXGI_USAGE_SHARED. I am able to successfully create the swap chain and have no problems using the swapchain regular. However, when I try to access the shared handle, I get S_OK and a NULL shared handle.

    Here is the code.

     

    // Get the swapchain's back buffer
    IDXGIResource * SharedBackBuffer;
    SwapChain->GetBuffer(0,
    __uuidof(IDXGIResource), reinterpret_cast<void**>(&SharedBackBuffer));

    // Obtain the handle to the surface
    HANDLE SharedHandle;
    SharedBackBuffer->GetSharedHandle(&SharedHandle);

    // Open the resource in our device and create the view to use the object
    ID3D10Texture2D * BackBuffer;
    m_Device->OpenSharedResource(SharedHandle,
    __uuidof(ID3D10Texture2D), reinterpret_cast<void**>(&BackBuffer));
    m_Device->CreateRenderTargetView(BackBuffer, NULL, &Data->BackbufferView);


    SharedHandle is NULL and the return value of GetSharedHandle is S_OK.

    Any help here would be much appreciated.

     

  • 21/10/2009 3:50 In reply to

    Re: DirectX10 SwapChain Shared Resource

    What OS are you using?

    What does the debug output say?

    Was the shared back buffer created by a D3D11 device?

Page 1 of 1 (2 items) Previous Next