Skip to main content
GameDev.net gamedev.net
🔒 Locked

Synchronous rendering

Started by methe Jun 28, 2007 at 8:28 AM 2 replies 850+ views
Original Post
methe
methe
Hi, I'd like to know if there is any way to know when a complete scene has been drawn. When EndScene() has been called on the device, all the commands are queued in the driver. How can I know when all these have been executed? In OpenGL one can force this flushing simpmly by calling glGetError() as this force the pipeline to empty before giving the user the requested feedback. Is there any "proper" way to do that in DX? Or even some hacky way? thx.
"A man does what he does because he sees the world as he sees it." A.K
DaBono
DaBono
Why would you want to do that? It would severely degrade performance.

One way I can imagine you could implement this, is to request to read back a frame from the frame buffer. Then the rendering would have to be synchronized, because you need the rendered data.
jollyjeffers
jollyjeffers
You can use queries to do this if you really want. I don't have the code fragments to hand, but look up the "accurately profiling Direct3D API calls" article in the SDK documentation.

Another common trick is to grab the current front buffer and lock a 1x1 rect, but that never struck me as a particularly 'clean' way of doing things...

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
methe
methe
Thanks for the answer. I was starting to look at querying (as you just pointed me) when I read about IDirect3DSwapChain9::Present() and I wondered if setting the last parameter to 0 wouldn't do the trick.

I quote the Documentation:
"If dwFlags = 0, this method behaves as it did prior to Direct3D 9. Present will spin until the hardware is free, without returning an error."

Is that it or am I mis-understanding what they mean by "free"?
"A man does what he does because he sees the world as he sees it." A.K

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.