Sign in to follow this  
jimzy

Dose DrawPrimitive return immediately while the GPU is busy?

Recommended Posts

Pseudocode: // pd->DrawPrimitive(....) ; //A. pd->DrawPrimitive(....) ;// B. pd->DrawPrimitive(....) ;// C. .... B will wait A complete , and C will wait B complete ?

Share this post


Link to post
Share on other sites
All state changes and draw calls are sent the card and placed in a queue, and processed in order. After your 'C' draw call, the GPU may not even have started drawing 'A', or 'B'. The D3D spec limits the queue to 3 frames worth of data, to ensure the app and GPU display don't get too far out of sync. The queue may contains hundreds of draw calls, state changes, render target changes, etc.

Some calls may cause D3D to wait until the queue empties, such as locking a vertex buffer or texture which is in use by a queued draw call. D3D will wait until drawing is complete to ensure the resource is no longer in use, then return with a pointer for your app to use. You should avoid such behaviour whenever possible.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this