ID3D11DeviceContext::Flush Method

Send queued-up commands in the command buffer to the GPU.

Syntax

void Flush();

Parameter

Methode umfasst keine Parameter.

Rückgabewert

Returns nothing.

Hinweise

Most applications will not need to call this method. Calling this method when not necessary will incur a performance penalty. Each call to Flush incurs a significant amount of overhead.

When Direct3D state-setting, present, or draw commands are called by an application, those commands are queued into an internal command buffer. Flush sends those commands to the GPU for processing. Normally, these commands are sent to the GPU automatically whenever Direct3D determines that they need to be, such as when the command buffer is full or when mapping a resource. Flush will send the commands manually.

Flush should be used when the CPU waits for an arbitrary amount of time (such as when calling Sleep).

Because Flush operates asynchronously, it can return either before or after the GPU finishes executing the queued graphics commands. However, the graphics commands will eventually always complete. You can call the ID3D11Device::CreateQuery method with the D3D11_QUERY_EVENT value to create an event query; you can then use that event query in a call to the ID3D11DeviceContext::GetData method to determine when the GPU is finished processing the graphics commands.

Direct3D11 defers the destruction of objects, an application cannot rely upon objects immediately being destroyed. Calling Flush will destroy any objects whose destruction has been deferred. If an application requires synchronous destruction of an object the application should release all its references, call ID3D11DeviceContext::ClearState, and then call Flush.

Anforderungen

Header

D3D11.h

Bibliothek

D3D11.lib

Siehe auch

ID3D11DeviceContext