• Advertisement
Sign in to follow this  

Blocking Calls until the GPU is Idle

This topic is 4178 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if anyone knew how to do this. Basically I have my profiler attempting to synch my CPU and GPU so that I can stabilize the engine. Anyway I have something like: void BlockUntilGPUIdle() { pDevice->BlockUntilIdle(); } Given that BlockUntilIdle() is not in the IDirect3DDevice9 its not going to work, does anyone know a way to block incoming calls in DX? Cheers

Share this post


Link to post
Share on other sites
Advertisement
You might be able to use Present() for something like this. Check out the "Why is present so slow?" entry in Tom Forsyth's FAQ for an explanation.

Most times, it is going to be the CPU waiting for the GPU, so you might not even have to deal with this.

Share this post


Link to post
Share on other sites
Something like this may be want you want...

IDirect3DQuery9 *pQuery;
BOOL data;

// create an event and spin wait on it
pDevice->CreateQuery(D3DQUERYTYPE_EVENT, &pQuery);
pQuery->Issue(D3DISSUE_END);
while (pQuery->GetData(&data, sizeof(data), D3DGETDATA_FLUSH) == S_FALSE) {} // busy wait
pQuery->Release();

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement