docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
- math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
- containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
- core: 修复 types 链接错误
- debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
- memory: 修复头文件路径, malloc vs operator new, 新增方法文档
- resources: 修复 Shader/Texture 链接错误
- threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
|
|
|
|
# D3D12DepthStencilView
|
|
|
|
|
|
|
|
|
|
|
|
**命名空间**: `XCEngine::RHI`
|
|
|
|
|
|
|
2026-03-20 02:35:45 +08:00
|
|
|
|
**类型**: `class`
|
|
|
|
|
|
|
|
|
|
|
|
**描述**: DirectX 12 深度模板视图的 D3D12 实现,用于渲染管线中的深度/模板测试。
|
|
|
|
|
|
|
|
|
|
|
|
## 概述
|
|
|
|
|
|
|
|
|
|
|
|
`D3D12DepthStencilView` 是 RHI 深度模板视图接口的 D3D12 特定实现。该类封装了 D3D12 深度模板视图(DSV)的创建和管理,提供两种初始化方式:自动分配描述符句柄或使用预分配的描述符句柄。深度模板视图是渲染管线中用于深度测试和模板测试的关键资源。
|
docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
- math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
- containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
- core: 修复 types 链接错误
- debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
- memory: 修复头文件路径, malloc vs operator new, 新增方法文档
- resources: 修复 Shader/Texture 链接错误
- threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
|
|
|
|
|
2026-03-19 02:01:18 +08:00
|
|
|
|
## 公共方法
|
docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
- math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
- containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
- core: 修复 types 链接错误
- debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
- memory: 修复头文件路径, malloc vs operator new, 新增方法文档
- resources: 修复 Shader/Texture 链接错误
- threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
|
|
|
|
|
2026-03-19 02:01:18 +08:00
|
|
|
|
| 方法 | 描述 |
|
docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
- math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
- containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
- core: 修复 types 链接错误
- debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
- memory: 修复头文件路径, malloc vs operator new, 新增方法文档
- resources: 修复 Shader/Texture 链接错误
- threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
|
|
|
|
|------|------|
|
2026-03-20 02:35:45 +08:00
|
|
|
|
| [`D3D12DepthStencilView()`](initialize.md) | 构造函数 |
|
|
|
|
|
|
| [`~D3D12DepthStencilView()`](initialize.md) | 析构函数 |
|
|
|
|
|
|
| [`Initialize`](initialize.md) | 初始化深度模板视图 |
|
|
|
|
|
|
| [`InitializeAt`](initialize-at.md) | 在指定位置初始化深度模板视图 |
|
|
|
|
|
|
| [`Shutdown`](shutdown.md) | 关闭深度模板视图 |
|
2026-03-19 02:01:18 +08:00
|
|
|
|
| [`GetCPUDescriptorHandle`](get-cpu-descriptor-handle.md) | 获取 CPU 描述符句柄 |
|
2026-03-20 02:35:45 +08:00
|
|
|
|
| [`CreateDesc`](create-desc.md) | 创建描述符(静态方法) |
|
|
|
|
|
|
|
|
|
|
|
|
## 使用示例
|
|
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
|
ID3D12Device* device; // 已初始化的 D3D12 设备
|
|
|
|
|
|
ID3D12Resource* depthBuffer; // 深度缓冲资源
|
|
|
|
|
|
|
|
|
|
|
|
D3D12DepthStencilView dsv;
|
|
|
|
|
|
dsv.Initialize(device, depthBuffer, nullptr);
|
|
|
|
|
|
|
|
|
|
|
|
D3D12_CPU_DESCRIPTOR_HANDLE handle = dsv.GetCPUDescriptorHandle();
|
|
|
|
|
|
// 使用 handle 进行渲染操作
|
|
|
|
|
|
|
|
|
|
|
|
dsv.Shutdown();
|
|
|
|
|
|
```
|
docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
- math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
- containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
- core: 修复 types 链接错误
- debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
- memory: 修复头文件路径, malloc vs operator new, 新增方法文档
- resources: 修复 Shader/Texture 链接错误
- threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
|
|
|
|
|
|
|
|
|
|
## 相关文档
|
|
|
|
|
|
|
2026-03-20 02:35:45 +08:00
|
|
|
|
- [D3D12 后端概览](../d3d12.md) - D3D12 后端模块总览
|
|
|
|
|
|
- [D3D12DescriptorHeap](../descriptor-heap/descriptor-heap.md) - 描述符堆管理
|
|
|
|
|
|
- [D3D12RenderTargetView](../render-target-view/render-target-view.md) - 渲染目标视图
|