> ## 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.

# DispatchRaysX (consoles XBOX Series)

> Version extensible de DispatchRays. L'ensemble de mémoire de travail peut être fourni par l'utilisateur.

Version extensible de DispatchRays. L'ensemble de mémoire de travail peut être fourni par l'utilisateur.

## Syntaxe

```cpp theme={null}
void DispatchRaysX(  
         const D3D12XBOX_DISPATCH_RAYS_DESC* pDesc  
)  
```

### Paramètres

*pDesc*   \_In\_\
Type : [D3D12XBOX\_DISPATCH\_RAYS\_DESC\*](/fr/reference/graphics/d3d12_xs/structs/d3d12xbox_dispatch_rays_desc)

En interne, DispatchRays utilise une allocation du pilote pour la pile DXR et synchronise automatiquement l'accès à cette mémoire. DispatchRaysX permet au titre de spécifier sa propre allocation de mémoire et sa taille. Le pilote redimensionne le Dispatch de raytracing interne en conséquence.

### Valeur de retour

Type : void

## Remarques

Exemple 1 : une application utilise sa propre allocation de mémoire et doit garantir une synchronisation correcte

```CPP theme={null}
D3D12XBOX_DISPATCH_RAYS_DESC dispatchDescX {};
dispatchDescX.DispatchArgs = dispatchDesc;
dispatchDescX.Scratch.StartAddress = m_customStackScratch->GetGPUVirtualAddress();
dispatchDescX.Scratch.SizeInBytes = CUSTOM_SCRATCH_SIZE;
m_commandList->DispatchRaysX(&dispatchDescX);  
```

Le dimensionnement de la mémoire de travail (scratch) peut être approximatif ; par exemple, le pilote utilise un espace de travail de même taille pour tous les dispatchs (il fait simplement varier le nombre de vagues en cours d'exécution), ou bien il peut être dimensionné de manière appropriée. Notez que des espaces de travail extrêmement restreints ont des conséquences sur les performances en raison de la réduction de l'occupation. Si un calcul plus précis est nécessaire, GetInformationX peut être utilisé pour l'interroger.

Exemple 2 : utilisation de GetInformationX pour interroger la quantité d'espace de travail nécessaire par vague

```CPP theme={null}
D3D12XBOX_RAYTRACING_INFORMATION stats {};
ComPtr<ID3D12StateObjectProperties> stateObjectProperties;
auto& ref = ComPtr<ID3D12StateObject>(pRTPSO);
ThrowIfFailed(ref.As(&stateObjectProperties));
stateObjectProperties->GetInformationX(0, &stats);  
```

La structure « stats » contient un champ appelé ScratchSize, qui correspond au nombre d'octets d'espace de travail requis par voie (lane). L'espace de travail est alloué par blocs de 1 024 o ; pour obtenir l'allocation sûre pour une vague, il faut donc calculer ScratchSize \* 32 (XDXR s'exécute toujours en interne en wave 32) et l'arrondir au Ko supérieur.

## Configuration requise

**En-tête :** d3d12\_xs.h

**Bibliothèque :** d3d12\_xs.lib\
**Plateformes prises en charge :** consoles XBOX Series

## Voir aussi

[ID3D12GraphicsCommandList6](/fr/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList6/id3d12graphicscommandlist6)


## Related topics

- [DispatchRays (consoles XBOX Series)](/fr/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_dispatchrays_public.md)
- [D3D12_DISPATCH_RAYS_DESC (consoles XBOX Series)](/fr/reference/graphics/d3d12/structs/d3d12_dispatch_rays_desc_public.md)
- [Dispatch](/fr/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_dispatch_public.md)
- [BuildRaytracingAccelerationStructure (consoles XBOX Series)](/fr/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_buildraytracingaccelerationstructure_public.md)
- [CopyRaytracingAccelerationStructure (consoles XBOX Series)](/fr/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_copyraytracingaccelerationstructure_public.md)
