> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RSSetShadingRate (XBOX Series consoles)

> The ID3D12GraphicsCommandList5::RSSetShadingRate method (d3d12.h) sets the base shading rate, and combiners, for variable-rate shading (VRS).

Sets the base shading rate, and combiners, for variable-rate shading (VRS). For more info, see [Variable-rate shading (VRS)](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/vrs).

## Syntax

```cpp theme={null}
void RSSetShadingRate(
    D3D12_SHADING_RATE baseShadingRate,
    const D3D12_SHADING_RATE_COMBINER  combiners
)
```

### Parameters

*baseShadingRate*\
Type: D3D12\_SHADING\_RATE

A constant from the [D3D12\_SHADING\_RATE](/reference/graphics/d3d12/enums/d3d12_shading_rate_public) enumeration describing the base shading rate to set.

*combiners*\
Type: const D3D12\_SHADING\_RATE\_COMBINER \*

An optional pointer to a constant array of [**D3D12\_SHADING\_RATE\_COMBINER**](/reference/graphics/d3d12/enums/d3d12_shading_rate_combiner_public) containing the shading rate combiners to set. The count of [**D3D12\_SHADING\_RATE\_COMBINER**](/reference/graphics/d3d12/enums/d3d12_shading_rate_combiner_public) elements in the array must be equal to the constant [**D3D12\_RS\_SET\_SHADING\_RATE\_COMBINER\_COUNT**](https://learn.microsoft.com/en-us/windows/win32/direct3d12/constants), which is equal to **2**.

Because per-primitive and screen-space image-based VRS isn't supported on Tier1 [Variable-rate shading (VRS)](https://learn.microsoft.com/en-us/windows/win32/direct3d12/vrs), for these values to be meaningful, the adapter requires Tier2 VRS support. See [**D3D12\_FEATURE\_DATA\_D3D12\_OPTIONS6**](/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options6_public) and [**D3D12\_VARIABLE\_SHADING\_RATE\_TIER**](/reference/graphics/d3d12/enums/d3d12_variable_shading_rate_tier_public).

A **NULL** pointer is equivalent to the default shading combiners, which are both [**D3D12\_SHADING\_RATE\_COMBINER\_PASSTHROUGH**](/reference/graphics/d3d12/enums/d3d12_shading_rate_combiner_public).

The algorithm for final shading-rate is determined by the following.

```cpp theme={null}
postRasterizerRate = ApplyCombiner(Combiners[0], CommandListShadingRate, Primitive->PrimitiveSpecifiedShadingRate);
finalRate = ApplyCombiner(Combiners[1], postRasterizerRate, ScreenSpaceImage[xy]);
```

where `ApplyCombiner` is

```cpp theme={null}
UINT ApplyCombiner(D3D12_SHADING_RATE_COMBINER combiner, UINT a, UINT b)
{
MaxShadingRate = options6.AdditionalShadingRatesSupported ? 4 : 2;
switch (combiner)
{
case D3D12_SHADING_RATE_COMBINER_PASSTHROUGH: // default
return a;
case D3D12_SHADING_RATE_COMBINER_OVERRIDE:
return b;
case D3D12_SHADING_RATE_COMBINER_MAX:
return max(a, b);
case D3D12_SHADING_RATE_COMBINER_MIN:
return min(a, b);
case D3D12_SHADING_RATE_COMBINER_SUM:
return min(MaxShadingRate, a + b);
case default:
return a;
}
}
```

### Return value

Type: void

None.

## Remarks

## Requirements

**Header:** d3d12\_xs.h\
**Library:** d3d12\_xs.lib\
**Supported Platforms**: XBOX Series consoles

## See Also

[Variable-rate shading (VRS)](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/vrs)


## Related topics

- [RSSetShadingRateImage (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist5/methods/id3d12graphicscommandlist5_rssetshadingrateimage_public.md)
- [D3D12_SHADING_RATE (XBOX Series consoles)](/reference/graphics/d3d12/enums/d3d12_shading_rate_public.md)
- [D3D12_AXIS_SHADING_RATE (XBOX Series consoles)](/reference/graphics/d3d12/enums/d3d12_axis_shading_rate_public.md)
- [Variable Rate Shading (VRS) on XBOX Series X|S](/build/core-features/graphics/newfeatures/vrs/index.md)
- [SetPipelineState1 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_setpipelinestate1_public.md)
