Blocking Calls until the GPU is Idle

Started by
2 comments, last by bobNinjaPenguin 17 years, 8 months ago
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
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.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
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();
Fantastic lads thanks. Great blog...

This topic is closed to new replies.

Advertisement