locked
Directx11 Leaks Memory without a present RRS feed

  • Question

  • I'm creating a WPF application with DirectX 11

    I have several threads running that render to a target on the thread
    Each thread has its own Device created as follows

    D3D_FEATURE_LEVEL featureLevels[] =
    {
     D3D_FEATURE_LEVEL_11_0,
     D3D_FEATURE_LEVEL_10_1,
     D3D_FEATURE_LEVEL_10_0,
    };
    UINT createDeviceFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
    UINT numFeatureLevels = _countof(featureLevels);
    D3D_FEATURE_LEVEL featureLevelOut;
    ID3D11DeviceContext* pD3D11DeviceContext;
    hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags,featureLevels,
         numFeatureLevels, D3D11_SDK_VERSION, &pD3D11Device,
         &featureLevelOut, &pD3D11DeviceContext);

    I do not create a swap chain, instead I call ID3D11DeviceContext::Flush As described
    http://gamedev.stackexchange.com/questions/51526/directx11-without-window-attached
    "Yes. You can initialize the Direct3D device using D3D11CreateDevice, which requires no window. You simply do not create a swap chain at all. You can still create offscreen render targets and draw to them in the usual way. Instead of calling Present on the swap chain, you can call ID3D11DeviceContext::Flush to kick the GPU with the work you've queued up."
     
    If I call ID3D11DeviceContext::Map in the rendering loop the memory continual grows
    If I create a swap chain and call present then the memory does not grow.

    I'm trying to avoid calling present because of the dead locking issues.
    Is not using a swap chain a valid approach?
    Is there a way to force the memory to clean up without calling present?




    • Edited by JQA871 Friday, November 1, 2013 9:56 PM
    • Moved by Xiaoliang Chen - MSFT Monday, November 4, 2013 1:50 AM
    • Moved by Jason Dot Wang Monday, November 25, 2013 8:05 AM This thread is about DirectX 11
    Friday, November 1, 2013 9:49 PM

All replies

  • Hi JQA871,

    For more professional response, I have moved this thread to WPF forum!

    Thanks for your understanding!

    Regards!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 4, 2013 1:51 AM
  • Hi JQA871,

      Welcome to MSDN Forum Support.

      You could take a look at Introducing DirectX to WPF. To start with DirectX you need to download the DirectX SDK
    which is good because it contains tons of tutorials and samples.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 6, 2013 6:08 AM
  • I have gone through many tutorials; none of them discuss this topic.

    Wednesday, November 6, 2013 4:32 PM
  • Hi JQA871,

      For more information about DirectX 11, you need to ask questions at http://xboxforums.create.msdn.com/forums/76.aspx where you can contact the more experts who is skilled in it.

      Sincerely,

      Jason Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 25, 2013 1:16 AM