> ## 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 (consoles XBOX Series)

> La méthode ID3D12GraphicsCommandList5::RSSetShadingRate (d3d12.h) définit le taux d'ombrage de base, ainsi que les combinateurs, pour l'ombrage à taux variable (VRS).

Définit le taux d'ombrage de base, ainsi que les combinateurs, pour l'ombrage à taux variable (VRS). Pour plus d'informations, consultez [Ombrage à taux variable (VRS)](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/vrs).

## Syntaxe

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

### Paramètres

*baseShadingRate*\
Type : D3D12\_SHADING\_RATE

Constante de l'énumération [D3D12\_SHADING\_RATE](/fr/reference/graphics/d3d12/enums/d3d12_shading_rate_public) décrivant le taux d'ombrage de base à définir.

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

Pointeur facultatif vers un tableau constant de [**D3D12\_SHADING\_RATE\_COMBINER**](/fr/reference/graphics/d3d12/enums/d3d12_shading_rate_combiner_public) contenant les combinateurs de taux d'ombrage à définir. Le nombre d'éléments [**D3D12\_SHADING\_RATE\_COMBINER**](/fr/reference/graphics/d3d12/enums/d3d12_shading_rate_combiner_public) du tableau doit être égal à la constante [**D3D12\_RS\_SET\_SHADING\_RATE\_COMBINER\_COUNT**](https://learn.microsoft.com/en-us/windows/win32/direct3d12/constants), qui est égale à **2**.

Étant donné que le VRS par primitive et le VRS basé sur une image en espace écran ne sont pas pris en charge au niveau Tier1 de l'[ombrage à taux variable (VRS)](https://learn.microsoft.com/en-us/windows/win32/direct3d12/vrs), la carte doit prendre en charge le VRS Tier2 pour que ces valeurs aient un sens. Consultez [**D3D12\_FEATURE\_DATA\_D3D12\_OPTIONS6**](/fr/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options6_public) et [**D3D12\_VARIABLE\_SHADING\_RATE\_TIER**](/fr/reference/graphics/d3d12/enums/d3d12_variable_shading_rate_tier_public).

Un pointeur **NULL** équivaut aux combinateurs d'ombrage par défaut, qui sont tous deux [**D3D12\_SHADING\_RATE\_COMBINER\_PASSTHROUGH**](/fr/reference/graphics/d3d12/enums/d3d12_shading_rate_combiner_public).

L'algorithme du taux d'ombrage final est déterminé comme suit.

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

où `ApplyCombiner` est

```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;
}
}
```

### Valeur renvoyée

Type : void

Aucune.

## Remarques

## Configuration requise

**En-tête :** d3d12\_xs.h\
**Bibliothèque :** d3d12\_xs.lib\
**Plateformes prises en charge** : consoles XBOX Series

## Voir aussi

[Ombrage à taux variable (VRS)](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/vrs)


## Related topics

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