D3D11X_GDS_OPERATION_FLAGS Enumeration

Flags to control WriteGDS and ReadGDS.

Syntax

typedef enum _D3D11X_GDS_OPERATION_FLAGS
{
    D3D11X_GDS_OPERATION_DEFAULT,
    D3D11X_GDS_OPERATION_READ_AT_EOS,
    D3D11X_GDS_OPERATION_READ_AT_TOP,
    D3D11X_GDS_OPERATION_WRITE_COPY_DATA_TO_CB,
    D3D11X_GDS_OPERATION_WRITE_USE_DATA_BY_POINTER,
    D3D11X_GDS_OPERATION_COMPUTE
} D3D11X_GDS_OPERATION_FLAGS;  

Constants

Constant Description
D3D11X_GDS_OPERATION_DEFAULT Indicates to use the default, which is D3D11X_GDS_OPERATION_READ_AT_EOS for ReadGDS, and D3D11X_GDS_OPERATION_WRITE_COPY_DATA_TO_CB for WriteGDS. These settings most closely represent the default DirectX 11 behavior of SetUAV and ID3D11DeviceContext::CopyStructureCount.
D3D11X_GDS_OPERATION_READ_AT_EOS A read of GDS will be pipelined and will occur at the end of shader (EOS). If any read access to the written GDS data is needed by the GPU shortly, InsertFence and InsertWaitOnFence (or ID3D11DeviceContextX::InsertWaitUntilIdle for async compute contexts) need to be called to block the Command Processor (CP) until the EOS write is completed. If the counters are to be read via the L2 cache (TCC), then a cache flush is going to be required. If the counters are to be via the CP, then no cache flush is required. If the written GDS data is used on the GPU far enough from where it’s written, then no synchronization is needed except a potential cache flush.
D3D11X_GDS_OPERATION_READ_AT_TOP Indicates that a non-pipelined read of GDS will be performed by the CP at the top of the pipe (TOP). This means that if there are any shaders in flight that modify GDS (for example, through UAV counters), the results of the read may be unexpected, because they will be a snapshot of a current state of GDS during shader execution. If there are no shaders in flight that use GDS, the results will be the same as in the EOS case. The same GPU write-read considerations apply as in the D3D11X_GDS_OPERATION_READ_AT_EOS.
D3D11X_GDS_OPERATION_WRITE_COPY_DATA_TO_CB Indicates that a GDS write can only be performed from a shader or from the CP, so WriteGDS performs writes are done at TOP. When a copy is asked for, the provided counter data is copied into the command buffer, and the source pointer can be discarded. The pointer doesn’t have to point to GPU mapped memory. This essentially performs a CPU->GDS copy.
D3D11X_GDS_OPERATION_WRITE_USE_DATA_BY_POINTER Indicates that a GDS write can only be performed from a shader or from the CP, so WriteGDS performs writes are done at TOP. When a copy-by-pointer is asked for, the provided counter data is used by the GPU when the packet gets to execute, which means the title needs to track hazards and the lifetime of the pCounterValues pointer, and the pCounterValue must be in the GPU mapped memory, otherwise a GPU crash is likely. This type of copy is more suitable for GPU->GPU GDS.
D3D11X_GDS_OPERATION_COMPUTE Indicates that the packet is related to compute (rather than graphics), such as to distinguish between the end-of-shaders (EOSes).

Remarks

This enumeration defines flags that are used by the following methods:

Refer to the fences and synchronization sections of Optimizing Monolithic Driver Performance for more details.

Requirements

Header: Declared in d3d11_x.h.