docs: 修复 D3D12 后端 API 文档问题

- 修复 texture/dtor.md 和 enums/enums.md 的错误链接
- 重命名 texture/ctor.md → constructor.md, texture/dtor.md → destructor.md
- 创建 command-list, fence, device, query-heap, sampler 的 constructor/destructor 文档
- 创建 D3D12Texture 缺失的 16 个方法文档
- 创建 D3D12CommandList 缺失的 12 个 internal 方法文档
- 补充 shader-resource-view 缺少的头文件和类型字段
This commit is contained in:
2026-03-22 02:08:51 +08:00
parent 2432a646ce
commit 1358bb0a5a
43 changed files with 1264 additions and 4 deletions

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::AliasBarrierInternal
别名屏障内部实现。
```cpp
void AliasBarrierInternal(ID3D12Resource* beforeResource, ID3D12Resource* afterResource);
```
## 参数
- `beforeResource` - 屏障前的资源
- `afterResource` - 屏障后的资源
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.AliasBarrierInternal(resource1.GetResource(), resource2.GetResource());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [AliasBarrier](alias-barrier.md) - 别名屏障

View File

@@ -0,0 +1,35 @@
# D3D12CommandList::ClearDepthStencilView
清除深度模板视图(句柄重载)。
```cpp
void ClearDepthStencilView(D3D12_CPU_DESCRIPTOR_HANDLE depthStencilHandle, uint32_t clearFlags, float depth = 1.0f, uint8_t stencil = 0, uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
```
## 参数
- `depthStencilHandle` - 深度模板视图 CPU 句柄
- `clearFlags` - 清除标志D3D12_CLEAR_FLAG_DEPTH / D3D12_CLEAR_FLAG_STENCIL
- `depth` - 深度值默认1.0f
- `stencil` - 模板值默认0
- `rectCount` - 矩形数量默认为0表示整个资源
- `rects` - 要清除的矩形数组默认为nullptr表示整个资源
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
commandList.ClearDepthStencilView(depthStencilHandle, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 1.0f, 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [ClearDepthStencil](clear-depth-stencil.md) - 清除深度模板

View File

@@ -0,0 +1,34 @@
# D3D12CommandList::ClearRenderTargetView
清除渲染目标视图(资源指针重载)。
```cpp
void ClearRenderTargetView(ID3D12Resource* renderTarget, const float color[4], uint32_t rectCount = 0, const D3D12_RECT* rects = nullptr);
```
## 参数
- `renderTarget` - D3D12 资源指针
- `color` - 清除颜色 RGBA
- `rectCount` - 矩形数量默认为0表示整个资源
- `rects` - 要清除的矩形数组默认为nullptr表示整个资源
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
float color[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
commandList.ClearRenderTargetView(renderTarget.GetResource(), color);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [ClearRenderTarget](clear-render-target.md) - 清除渲染目标

View File

@@ -0,0 +1,35 @@
# D3D12CommandList::D3D12CommandList
构造函数,创建一个空的 D3D12CommandList 对象。
```cpp
D3D12CommandList();
```
## 参数
## 返回值
**线程安全:** 非线程安全
**复杂度:** O(1)
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12CommandList.h"
D3D12CommandList commandList;
// 需要调用 Initialize 进行初始化
commandList.Initialize(device, CommandQueueType::Direct);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [Initialize](initialize.md) - 初始化命令列表
- [Shutdown](shutdown.md) - 关闭命令列表

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::CopyResourceInternal
复制资源内部实现。
```cpp
void CopyResourceInternal(ID3D12Resource* dst, ID3D12Resource* src);
```
## 参数
- `dst` - 目标资源
- `src` - 源资源
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
commandList.CopyResourceInternal(dstResource.GetResource(), srcResource.GetResource());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [CopyResource](copy-resource.md) - 复制资源

View File

@@ -0,0 +1,36 @@
# D3D12CommandList::~D3D12CommandList
析构函数,销毁 D3D12CommandList 对象。
```cpp
~D3D12CommandList() override;
```
## 参数
## 返回值
**线程安全:** 非线程安全,请在所有 GPU 操作完成后销毁对象
**复杂度:** O(n) - 取决于资源释放时间
## 示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12CommandList.h"
{
D3D12CommandList commandList;
commandList.Initialize(device, CommandQueueType::Direct);
// ... 使用 commandList ...
} // 超出作用域时自动调用析构函数
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [Shutdown](shutdown.md) - 关闭命令列表

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::DispatchIndirectInternal
间接分发计算任务内部实现。
```cpp
void DispatchIndirectInternal(ID3D12Resource* argBuffer, uint64_t alignedByteOffset);
```
## 参数
- `argBuffer` - 参数缓冲区
- `alignedByteOffset` - 字节偏移
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.DispatchIndirectInternal(argBuffer.GetResource(), 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [DispatchIndirect](dispatch-indirect.md) - 间接分发计算任务

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::DrawIndexedInstancedIndirectInternal
索引实例化间接绘制内部实现。
```cpp
void DrawIndexedInstancedIndirectInternal(ID3D12Resource* argBuffer, uint64_t alignedByteOffset);
```
## 参数
- `argBuffer` - 参数缓冲区
- `alignedByteOffset` - 字节偏移
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.DrawIndexedInstancedIndirectInternal(argBuffer.GetResource(), 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [DrawIndexedInstancedIndirect](draw-indexed-instanced-indirect.md) - 索引实例化间接绘制

View File

@@ -0,0 +1,31 @@
# D3D12CommandList::DrawInstancedIndirectInternal
实例化间接绘制内部实现。
```cpp
void DrawInstancedIndirectInternal(ID3D12Resource* argBuffer, uint64_t alignedByteOffset);
```
## 参数
- `argBuffer` - 参数缓冲区
- `alignedByteOffset` - 字节偏移
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.DrawInstancedIndirectInternal(argBuffer.GetResource(), 0);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [DrawInstancedIndirect](draw-instanced-indirect.md) - 实例化间接绘制

View File

@@ -0,0 +1,32 @@
# D3D12CommandList::SetIndexBufferInternal
设置索引缓冲区内部实现。
```cpp
void SetIndexBufferInternal(ID3D12Resource* buffer, uint64_t offset, Format indexFormat);
```
## 参数
- `buffer` - D3D12 资源指针
- `offset` - 缓冲区偏移
- `indexFormat` - 索引格式
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.SetIndexBufferInternal(indexBuffer.GetResource(), 0, Format::R16_UINT);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetIndexBuffer](set-index-buffer.md) - 设置索引缓冲区

View File

@@ -0,0 +1,30 @@
# D3D12CommandList::SetPipelineStateInternal
设置管线状态内部实现。
```cpp
void SetPipelineStateInternal(ID3D12PipelineState* pso);
```
## 参数
- `pso` - D3D12 管线状态对象
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.SetPipelineStateInternal(pipelineState->GetPipelineState());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetPipelineState](set-pipeline-state.md) - 设置管线状态

View File

@@ -0,0 +1,33 @@
# D3D12CommandList::SetVertexBufferInternal
设置顶点缓冲区内部实现。
```cpp
void SetVertexBufferInternal(uint32_t slot, ID3D12Resource* buffer, uint64_t offset, uint32_t stride);
```
## 参数
- `slot` - 顶点缓冲区槽位
- `buffer` - D3D12 资源指针
- `offset` - 缓冲区偏移
- `stride` - 顶点步长
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.SetVertexBufferInternal(0, vertexBuffer.GetResource(), 0, sizeof(Vertex));
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetVertexBuffer](set-vertex-buffer.md) - 设置顶点缓冲区

View File

@@ -0,0 +1,35 @@
# D3D12CommandList::SetVertexBuffersInternal
设置多个顶点缓冲区内部实现。
```cpp
void SetVertexBuffersInternal(uint32_t startSlot, uint32_t count, const D3D12_VERTEX_BUFFER_VIEW* views);
```
## 参数
- `startSlot` - 起始槽位
- `count` - 缓冲区数量
- `views` - 顶点缓冲区视图数组
## 返回值
**线程安全:**
**复杂度:** O(n)
## 示例
```cpp
D3D12_VERTEX_BUFFER_VIEW views[2];
views[0] = vertexBuffer1View;
views[1] = vertexBuffer2View;
commandList.SetVertexBuffersInternal(0, 2, views);
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [SetVertexBuffers](set-vertex-buffers.md) - 设置多个顶点缓冲区

View File

@@ -0,0 +1,30 @@
# D3D12CommandList::UAVBarrierInternal
UAV 屏障内部实现。
```cpp
void UAVBarrierInternal(ID3D12Resource* resource);
```
## 参数
- `resource` - D3D12 资源指针
## 返回值
**线程安全:**
**复杂度:** O(1)
## 示例
```cpp
commandList.UAVBarrierInternal(texture.GetResource());
```
## 相关文档
- [D3D12CommandList 总览](command-list.md)
- [UAVBarrier](uav-barrier.md) - UAV 屏障