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

# DispatchRays (XBOX Series 主机)

> 启动光线生成着色器的线程。

启动光线生成着色器的线程。

## 语法

```cpp theme={null}
void DispatchRays(
    const D3D12_DISPATCH_RAYS_DESC  pDesc
)
```

### 参数

*pDesc \[in]*\
类型：const D3D12\_DISPATCH\_RAYS\_DESC \*

光线调度的描述

### 返回值

类型：void

无。

## 备注

此方法可以从图形或计算命令列表以及捆绑包中调用。

必须在命令列表上设置光线跟踪管线状态。否则，此调用的行为未定义。

传入 3 个维度以设置网格大小：宽度/高度/深度。这些维度受到约束，使得 width \* height \* depth \<= 2^30。超过此限制会产生未定义的行为。
如果任何网格维度为 0，则不会启动任何线程。

## 要求

**头文件：** d3d12\_xs.h\
**库：** d3d12\_xs.lib\
**支持的平台**：XBOX Series 主机

## 另请参阅

[ID3D12GraphicsCommandList4](/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList4/id3d12graphicscommandlist4)


## Related topics

- [D3D12_DISPATCH_RAYS_DESC (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/structs/d3d12_dispatch_rays_desc_public.md)
- [Dispatch](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_dispatch_public.md)
- [BuildRaytracingAccelerationStructure (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_buildraytracingaccelerationstructure_public.md)
- [CopyRaytracingAccelerationStructure (XBOX Series 主机)](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_copyraytracingaccelerationstructure_public.md)
- [IGameInputDispatcher::Dispatch](/zh-CN/reference/input/gameinput/interfaces/IGameInputDispatcher/methods/igameinputdispatcher_dispatch.md)
