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

# CreateConstantBufferView

> 创建用于访问资源数据的常量缓冲区视图。

创建用于访问资源数据的常量缓冲区视图。

## 语法

```cpp theme={null}
void CreateConstantBufferView(
    const D3D12_CONSTANT_BUFFER_VIEW_DESC  pDesc,
    D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor
)
```

### 参数

*pDesc \[in, optional]*\
类型：const D3D12\_CONSTANT\_BUFFER\_VIEW\_DESC \*

指向描述常量缓冲区视图的 [D3D12\_CONSTANT\_BUFFER\_VIEW\_DESC](/reference/graphics/d3d12/structs/d3d12_constant_buffer_view_desc_public) 结构体的指针。

*DestDescriptor \[in]*\
类型：D3D12\_CPU\_DESCRIPTOR\_HANDLE

描述表示存放常量缓冲区视图的堆起始位置的 CPU 描述符句柄。

### 返回值

类型：void

无。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h\
**库：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支持的平台**：XBOX Series 主机和 XBOX One 系列

## 另请参阅

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)


## Related topics

- [D3D12_CONSTANT_BUFFER_VIEW_DESC](/zh-CN/reference/graphics/d3d12/structs/d3d12_constant_buffer_view_desc_public.md)
- [D3D12_CPU_DESCRIPTOR_HANDLE](/zh-CN/reference/graphics/d3d12/structs/d3d12_cpu_descriptor_handle_public.md)
- [SetComputeRootConstantBufferView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setcomputerootconstantbufferview_public.md)
- [SetGraphicsRootConstantBufferView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setgraphicsrootconstantbufferview_public.md)
- [CreateRenderTargetView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createrendertargetview_public.md)
