What is the best way of using GetData? RRS feed

  • Question

  • Hi all,

    I'm talking about this API ID3D11DeviceContext::GetData.

    If I want to make sure that GPU's task is done and ready, some articles said:

    while ( S_OK != GetData (...) ) {};

    However this way increase the CPU usage about 10%+, and is there any possibility enable an infinite loop?

    Is there any better way to implement GetData such as callback?


    • Edited by gogoqaz Tuesday, January 28, 2014 2:48 AM
    Tuesday, January 28, 2014 2:33 AM


  • Generally the issue is that you don't want to synchronize the CPU and GPU more than perhaps once a frame... You should look to find ways to keep the CPU doing useful work rather than busy-waiting.
    Tuesday, January 28, 2014 7:31 AM