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:
31
docs/api/rhi/d3d12/command-list/alias-barrier-internal.md
Normal file
31
docs/api/rhi/d3d12/command-list/alias-barrier-internal.md
Normal 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) - 别名屏障
|
||||
35
docs/api/rhi/d3d12/command-list/clear-depth-stencil-view.md
Normal file
35
docs/api/rhi/d3d12/command-list/clear-depth-stencil-view.md
Normal 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) - 清除深度模板
|
||||
34
docs/api/rhi/d3d12/command-list/clear-render-target-view.md
Normal file
34
docs/api/rhi/d3d12/command-list/clear-render-target-view.md
Normal 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) - 清除渲染目标
|
||||
35
docs/api/rhi/d3d12/command-list/constructor.md
Normal file
35
docs/api/rhi/d3d12/command-list/constructor.md
Normal 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) - 关闭命令列表
|
||||
31
docs/api/rhi/d3d12/command-list/copy-resource-internal.md
Normal file
31
docs/api/rhi/d3d12/command-list/copy-resource-internal.md
Normal 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) - 复制资源
|
||||
36
docs/api/rhi/d3d12/command-list/destructor.md
Normal file
36
docs/api/rhi/d3d12/command-list/destructor.md
Normal 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) - 关闭命令列表
|
||||
@@ -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) - 间接分发计算任务
|
||||
@@ -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) - 索引实例化间接绘制
|
||||
@@ -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) - 实例化间接绘制
|
||||
32
docs/api/rhi/d3d12/command-list/set-index-buffer-internal.md
Normal file
32
docs/api/rhi/d3d12/command-list/set-index-buffer-internal.md
Normal 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) - 设置索引缓冲区
|
||||
@@ -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) - 设置管线状态
|
||||
@@ -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) - 设置顶点缓冲区
|
||||
@@ -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) - 设置多个顶点缓冲区
|
||||
30
docs/api/rhi/d3d12/command-list/uav-barrier-internal.md
Normal file
30
docs/api/rhi/d3d12/command-list/uav-barrier-internal.md
Normal 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 屏障
|
||||
Reference in New Issue
Block a user