Jump to content
  • Advertisement
Sign in to follow this  
jimzy

Dose DrawPrimitive return immediately while the GPU is busy?

This topic is 4614 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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!