ID3D11DeviceContextX::CSEnableAutomaticGpuFlush Method

Enables or disables automatic GPU flushing for the Compute Shader.

Syntax

public:
void CSEnableAutomaticGpuFlush(
         BOOL Enable
)  

Parameters

Enable
Type: BOOL 

[in] true enables automatic GPU flushing. false disables automatic GPU flushing.

Return value

None.

Remarks

If a title has multiple ID3D11DeviceContext::Dispatch calls in a row, you may be able save significant GPU time by manually controlling hazard tracking.

By default, the driver inserts GPU flushes in between every Dispatch call, to avoid hazards with UAVs where one Dispatch might write to a UAV and the next Dispatch immediately reads from the same UAV. Such a case requires a partial flush to be issued to the hardware to ensure proper coherency with the read-after-write. It is too much overhead for the driver to properly track the true dependencies, so by default it simply and conservatively always issues such a flush after every Dispatch. But if you know that you do not have any such hazard problem with your Dispatch (that is, you know that the results of one Dispatch aren’t fed directly into the next one) you can stop the driver from doing this by calling CSEnableAutomaticGpuFlush(FALSE). This will inhibit all the driver’s automatic partial flushes and allow you to have complete control. Doing so can save significant GPU time that is lost to partial pipeline idling, particularly when there are a large number of small dispatches.

If you need to insert synchronization, you can call GpuSendPipelinedEvent( D3D11X_GPU_PIPELINED_EVENT_CS_PARTIAL_FLUSH ).

To again resume the driver’s default behavior, you can call CSEnableAutomaticGpuFlush(TRUE).

Requirements

Header: Declared in d3d11_x.h.

Library: Use d3d11_x.lib.

See also

Reference

ID3D11DeviceContextX Interface

ID3D11DeviceContextX Members