public:
void SetGraphicsShaderLimits(
const D3D11X_GRAPHICS_SHADER_LIMITS *pShaderLimits
)
pShaderLimits
Type: D3D11X_GRAPHICS_SHADER_LIMITS *
[in, optional] The shader limits, as a pointer to a D3D11X_GRAPHICS_SHADER_LIMITS structure. “nullptr” causes the driver to revert to its internal defaults.
Populate the members of an instance of the D3D11X_GRAPHICS_SHADER_LIMITS structure and pass the structure to SetGraphicsShaderLimits. Usage example:
D3D11X_GRAPHICS_SHADER_LIMITS gfxLimits =
{
D3D11X_SHADER_MAX_WAVES_WITH_LATE_ALLOC_PARAMETER_CACHE_DEFAULT, // MaxWavesWithLateAllocParameterCache
0, // VSDisableCuMask
0, // DSDisableCuMask
0, // GSDisableCuMask
0, // PSDisableCuMask
D3D11X_SHADER_MAX_WAVES_DEFAULT, // VSMaxWaves
D3D11X_SHADER_MAX_WAVES_DEFAULT, // HSMaxWaves
D3D11X_SHADER_MAX_WAVES_DEFAULT, // DSMaxWaves
D3D11X_SHADER_MAX_WAVES_DEFAULT, // GSMaxWaves
D3D11X_SHADER_MAX_WAVES_DEFAULT, // PSMaxWaves
D3D11X_SHADER_MAX_WAVES_FOR_CU_LOCKING_DEFAULT, // VSMaxWavesForCuLocking
D3D11X_SHADER_MAX_WAVES_FOR_CU_LOCKING_DEFAULT, // HSMaxWavesForCuLocking
D3D11X_SHADER_MAX_WAVES_FOR_CU_LOCKING_DEFAULT, // DSMaxWavesForCuLocking
D3D11X_SHADER_MAX_WAVES_FOR_CU_LOCKING_DEFAULT, // GSMaxWavesForCuLocking
D3D11X_SHADER_MAX_WAVES_FOR_CU_LOCKING_DEFAULT, // PSMaxWavesForCuLocking
};
pCtx->SetGraphicsShaderLimits( &gfxLimits );
The units are in waves per GPU, with maximum acceptable values in XXX_MAX constants. The driver will adjust for granularity. There are also XXX_DISABLE constants to explicitly disable the various limits. It will also do the remapping of VS to LS and such. There is parameter checking to reduce the likelihood of invalid configurations. Passing incorrect values to SetGraphicsShaderLimits could hang the GPU.
For example, setting the VSMaxWaves member to 12 means “I don’t want more than 12 VS waves to be running simultaneously”. This setting is likely to be the most effective to avoid cache thrashing.
Prior to the May 2015 XDK, the driver sets the MaxWavesWithLateAllocParameterCache member to 0 by default, in the D3D11X_GRAPHICS_SHADER_LIMITS structure. In the May 2015 XDK, MaxWavesWithLateAllocParameterCache is set to 22 by default. This increases the title’s performance on average, but can also slow down some rendering passes (usually when PS+VS can’t achieve occupancy higher than about 3 together). To find optimal settings for different part of the scene, use Dr. PIX experiments.
Setting MaxWavesWithLateAllocParameterCache higher than 22 may lead to GPU deadlocks. If these deadlocks are caused by a GPU pipeline transition, these deadlocks might be rare and difficult to reproduce. To prevent such deadlocks with high settings of the MaxWavesWithLateAllocParameterCache member, we require the VSDisableCUMask member to be nonzero, so at least one CU is not running vertex shaders, thus preventing deadlocks. Typically, the performance impact due to the masking operation is negligible compared to the performance gains from setting MaxWavesWithLateAllocParameterCache.
Header: Declared in d3d11_x.h.
Library: Use d3d11_x.lib.