ID3D11DeviceContextX::SetGDSRange Method

Sets the GDS range.

Syntax

public:
void SetGDSRange(
         D3D11X_GDS_REGION_TYPE RegionType,
         UINT OffsetDwords,
         UINT NumDwords
)  

Parameters

RegionType
Type: D3D11X_GDS_REGION_TYPE 

[in] The shader binding region of the GDS area, as a D3D11X_GDS_REGION_TYPE enumeration constant.

OffsetDwords
Type: UINT 

[in] The offset of the GDS pool in DWORDS for the base of the GDS range. The maximum is 32KB (8192 DWORDS).

NumDwords
Type: UINT 

[in] The number of DWORDs that will be limit the amount of GDS used by the shader.

On Xbox One GPU, the UAV counters are stored in GDS. Performing atomic operations is faster in GDS than in main memory, so AppendBuffers and ConsumeBuffers use GDS for the counters by default, to reduce contention on the main memory. Each counter is 4 bytes, and by default, 32KB of GDS memory is made available to the titles by the driver. Legacy context always expects to use ranges [0..63] DWORDS for PS UAV counters, and [64..127] DWORDS for CS UAV counters; however, the GDS range is shared between legacy and fast object semantics contexts, so if you override it on a Fast Object Semantic (FOS) context by using SetGDSRange, you should make sure to restore it to defaults before using UAV counters on a legacy context. To do that, use the following #define constants:

#define D3D11X_GDS_DEFAULT_PS_BASE      0
#define D3D11X_GDS_DEFAULT_CS_BASE      64
#define D3D11X_GDS_DEFAULT_PS_SIZE      64
#define D3D11X_GDS_DEFAULT_CS_SIZE      64  

Note that as legacy and FOS contexts are executed in order by the GPU, it is unlikely that SetGDSRange ever will be required to be called on those. For Async Compute Contexts, however, the situation is different. They are executed in parallel with legacy and FOS contexts, and therefore to avoid race conditions with async compute UAV counters, each Async Compute Context ideally should have a separate range of GDS memory allocated by calling SetGDSRange. A setting of SetGDSRange method is stored per Async Compute Context, and doesn’t impact legacy and FOS context setting.

Return value

None.

Remarks

SetGDSRange, ID3D11DeviceContextX::WriteGDS, and ID3D11DeviceContextX::ReadGDS only work on fast object semantic contexts and async compute contexts.

Requirements

Header: Declared in d3d11_x.h.

Library: Use d3d11_x.lib.

See also

Reference

ID3D11DeviceContextX Interface

ID3D11DeviceContextX Members