fix: improve doc link navigation and tree display

- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
This commit is contained in:
2026-03-19 12:44:08 +08:00
parent e003fe6513
commit 58a83f445a
1012 changed files with 56880 additions and 22 deletions

View File

@@ -0,0 +1,22 @@
# RHICommandList::ClearDepthStencil
```cpp
virtual void ClearDepthStencil(void* depthStencil, float depth, uint8_t stencil) = 0;
```
清除深度模板缓冲区。
**参数:**
- `depthStencil` - 深度模板缓冲区指针
- `depth` - 深度值
- `stencil` - 模板值
**示例:**
```cpp
cmdList->ClearDepthStencil(depthStencil, 1.0f, 0);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,22 @@
# RHICommandList::ClearRenderTarget
```cpp
virtual void ClearRenderTarget(void* renderTarget, const float color[4]) = 0;
```
清除渲染目标。
**参数:**
- `renderTarget` - 渲染目标指针
- `color` - 清除颜色 [r, g, b, a]
**示例:**
```cpp
float color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
cmdList->ClearRenderTarget(renderTarget, color);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,20 @@
# RHICommandList::Clear
```cpp
virtual void Clear(float r, float g, float b, float a, uint32_t buffers) = 0;
```
清除渲染目标。
**参数:**
- `r` - 红色分量
- `g` - 绿色分量
- `b` - 蓝色分量
- `a` - Alpha 分量
- `buffers` - 要清除的缓冲区标志
**复杂度:** O(1)
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,13 @@
# RHICommandList::Close
```cpp
virtual void Close() = 0;
```
关闭命令列表以执行。
**复杂度:** O(1)
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,55 @@
# RHICommandList
**命名空间**: `XCEngine::RHI`
**类型**: `class` (abstract)
**描述**: GPU 命令列表抽象接口,用于录制和执行 GPU 命令。
## 公共方法
| 方法 | 描述 |
|------|------|
| [`Reset`](reset.md) | 重置命令列表 |
| [`Close`](close.md) | 关闭命令列表 |
| [`TransitionBarrier`](transition-barrier.md) | 资源状态转换 |
| [`SetPipelineState`](set-pipeline-state.md) | 设置管线状态 |
| [`SetPrimitiveTopology`](set-primitive-topology.md) | 设置图元拓扑 |
| [`SetViewport`](set-viewport.md) | 设置视口 |
| [`SetViewports`](set-viewports.md) | 设置多个视口 |
| [`SetScissorRect`](set-scissor-rect.md) | 设置裁剪矩形 |
| [`SetScissorRects`](set-scissor-rects.md) | 设置多个裁剪矩形 |
| [`SetRenderTargets`](set-render-targets.md) | 设置渲染目标 |
| [`SetDepthStencilState`](set-depth-stencil-state.md) | 设置深度模板状态 |
| [`SetStencilRef`](set-stencil-ref.md) | 设置模板引用值 |
| [`SetBlendState`](set-blend-state.md) | 设置混合状态 |
| [`SetBlendFactor`](set-blend-factor.md) | 设置混合因子 |
| [`SetVertexBuffer`](set-vertex-buffer.md) | 设置顶点缓冲 |
| [`SetVertexBuffers`](set-vertex-buffers.md) | 设置多个顶点缓冲 |
| [`SetIndexBuffer`](set-index-buffer.md) | 设置索引缓冲 |
| [`Draw`](draw.md) | 绘制 |
| [`DrawIndexed`](draw-indexed.md) | 索引绘制 |
| [`Clear`](clear.md) | 清除 |
| [`ClearRenderTarget`](clear-render-target.md) | 清除渲染目标 |
| [`ClearDepthStencil`](clear-depth-stencil.md) | 清除深度模板 |
| [`CopyResource`](copy-resource.md) | 复制资源 |
| [`Dispatch`](dispatch.md) | 分发计算任务 |
| [`Shutdown`](shutdown.md) | 关闭并释放资源 |
## 使用示例
```cpp
commandList->Reset();
commandList->SetPipelineState(pipelineState);
commandList->SetPrimitiveTopology(PrimitiveTopology::TriangleList);
commandList->SetViewport(viewport);
commandList->SetRenderTargets(1, &renderTarget, depthStencil);
commandList->DrawIndexed(indexCount, 1, 0, 0, 0);
commandList->Close();
commandQueue->ExecuteCommandLists(1, (void**)&commandList);
```
## 相关文档
- [../rhi/rhi.md](../rhi.md) - RHI 模块总览
- [RHICommandQueue](../command-queue/command-queue.md) - 命令队列

View File

@@ -0,0 +1,21 @@
# RHICommandList::CopyResource
```cpp
virtual void CopyResource(void* dst, void* src) = 0;
```
复制资源。
**参数:**
- `dst` - 目标资源
- `src` - 源资源
**示例:**
```cpp
cmdList->CopyResource(dstTexture, srcTexture);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,22 @@
# RHICommandList::Dispatch
```cpp
virtual void Dispatch(uint32_t x, uint32_t y, uint32_t z) = 0;
```
分发计算着色器。
**参数:**
- `x` - X 方向线程组数量
- `y` - Y 方向线程组数量
- `z` - Z 方向线程组数量
**示例:**
```cpp
cmdList->Dispatch(8, 8, 1); // 分发 8x8x1 线程组
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,24 @@
# RHICommandList::DrawIndexed
```cpp
virtual void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t startIndex = 0, int32_t baseVertex = 0, uint32_t startInstance = 0) = 0;
```
绘制索引图元。
**参数:**
- `indexCount` - 索引数量
- `instanceCount` - 实例数量默认1
- `startIndex` - 起始索引
- `baseVertex` - 基础顶点索引
- `startInstance` - 起始实例索引
**示例:**
```cpp
cmdList->DrawIndexed(36); // 绘制36个索引
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,23 @@
# RHICommandList::Draw
```cpp
virtual void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t startVertex = 0, uint32_t startInstance = 0) = 0;
```
绘制调用。
**参数:**
- `vertexCount` - 顶点数量
- `instanceCount` - 实例数量默认1
- `startVertex` - 起始顶点索引
- `startInstance` - 起始实例索引
**示例:**
```cpp
cmdList->Draw(36); // 绘制36个顶点
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,201 @@
# RHICommandList 方法
## Reset
```cpp
virtual void Reset() = 0;
```
重置命令列表,开始新的录制。
## Close
```cpp
virtual void Close() = 0;
```
关闭命令列表,结束录制。
## TransitionBarrier
```cpp
virtual void TransitionBarrier(void* resource, ResourceStates stateBefore, ResourceStates stateAfter) = 0;
```
资源状态转换屏障。
## SetPipelineState
```cpp
virtual void SetPipelineState(void* pso) = 0;
```
设置管线状态对象。
## SetPrimitiveTopology
```cpp
virtual void SetPrimitiveTopology(PrimitiveTopology topology) = 0;
```
设置图元拓扑。
## SetViewport
```cpp
virtual void SetViewport(const Viewport& viewport) = 0;
```
设置视口。
## SetViewports
```cpp
virtual void SetViewports(uint32_t count, const Viewport* viewports) = 0;
```
设置多个视口。
## SetScissorRect
```cpp
virtual void SetScissorRect(const Rect& rect) = 0;
```
设置裁剪矩形。
## SetScissorRects
```cpp
virtual void SetScissorRects(uint32_t count, const Rect* rects) = 0;
```
设置多个裁剪矩形。
## SetRenderTargets
```cpp
virtual void SetRenderTargets(uint32_t count, void** renderTargets, void* depthStencil = nullptr) = 0;
```
设置渲染目标。
## SetDepthStencilState
```cpp
virtual void SetDepthStencilState(const DepthStencilState& state) = 0;
```
设置深度模板状态。
## SetStencilRef
```cpp
virtual void SetStencilRef(uint8_t ref) = 0;
```
设置模板参考值。
## SetBlendState
```cpp
virtual void SetBlendState(const BlendState& state) = 0;
```
设置混合状态。
## SetBlendFactor
```cpp
virtual void SetBlendFactor(const float factor[4]) = 0;
```
设置混合因子。
## SetVertexBuffer
```cpp
virtual void SetVertexBuffer(uint32_t slot, void* buffer, uint64_t offset, uint32_t stride) = 0;
```
设置顶点缓冲。
## SetVertexBuffers
```cpp
virtual void SetVertexBuffers(uint32_t startSlot, uint32_t count, const uint64_t* buffers, const uint64_t* offsets, const uint32_t* strides) = 0;
```
设置多个顶点缓冲。
## SetIndexBuffer
```cpp
virtual void SetIndexBuffer(void* buffer, uint64_t offset, Format format) = 0;
```
设置索引缓冲。
## Draw
```cpp
virtual void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t startVertex = 0, uint32_t startInstance = 0) = 0;
```
绘制调用。
## DrawIndexed
```cpp
virtual void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t startIndex = 0, int32_t baseVertex = 0, uint32_t startInstance = 0) = 0;
```
索引绘制调用。
## Clear
```cpp
virtual void Clear(float r, float g, float b, float a, uint32_t buffers) = 0;
```
清除缓冲。
## ClearRenderTarget
```cpp
virtual void ClearRenderTarget(void* renderTarget, const float color[4]) = 0;
```
清除渲染目标。
## ClearDepthStencil
```cpp
virtual void ClearDepthStencil(void* depthStencil, float depth, uint8_t stencil) = 0;
```
清除深度模板。
## CopyResource
```cpp
virtual void CopyResource(void* dst, void* src) = 0;
```
复制资源。
## Dispatch
```cpp
virtual void Dispatch(uint32_t x, uint32_t y, uint32_t z) = 0;
```
分发计算着色器。
## Shutdown
```cpp
virtual void Shutdown() = 0;
```
释放命令列表资源。

View File

@@ -0,0 +1,13 @@
# RHICommandList::Reset
```cpp
virtual void Reset() = 0;
```
重置命令列表以重新录制。
**复杂度:** O(1)
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,21 @@
# RHICommandList::SetBlendFactor
```cpp
virtual void SetBlendFactor(const float factor[4]) = 0;
```
设置混合因子。
**参数:**
- `factor` - 混合因子数组 [r, g, b, a]
**示例:**
```cpp
float factor[4] = {0.5f, 0.5f, 0.5f, 1.0f};
cmdList->SetBlendFactor(factor);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,23 @@
# RHICommandList::SetBlendState
```cpp
virtual void SetBlendState(const BlendState& state) = 0;
```
设置混合状态。
**参数:**
- `state` - 混合状态结构体
**示例:**
```cpp
BlendState blendState;
blendState.alphaToCoverageEnable = false;
blendState.independentBlendEnable = false;
cmdList->SetBlendState(blendState);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,24 @@
# RHICommandList::SetDepthStencilState
```cpp
virtual void SetDepthStencilState(const DepthStencilState& state) = 0;
```
设置深度模板状态。
**参数:**
- `state` - 深度模板状态结构体
**示例:**
```cpp
DepthStencilState dsState;
dsState.depthEnable = true;
dsState.depthWriteMask = true;
dsState.depthFunc = ComparisonFunc::Less;
cmdList->SetDepthStencilState(dsState);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,22 @@
# RHICommandList::SetIndexBuffer
```cpp
virtual void SetIndexBuffer(void* buffer, uint64_t offset, Format format) = 0;
```
设置索引缓冲区。
**参数:**
- `buffer` - 索引缓冲区指针
- `offset` - 数据偏移量
- `format` - 索引格式R16_UINT 或 R32_UINT
**示例:**
```cpp
cmdList->SetIndexBuffer(indexBuffer, 0, Format::R16_UINT);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,20 @@
# RHICommandList::SetPipelineState
```cpp
virtual void SetPipelineState(void* pso) = 0;
```
设置渲染管线状态对象。
**参数:**
- `pso` - 管线状态对象指针
**示例:**
```cpp
cmdList->SetPipelineState(pipelineState);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,20 @@
# RHICommandList::SetPrimitiveTopology
```cpp
virtual void SetPrimitiveTopology(PrimitiveTopology topology) = 0;
```
设置图元拓扑类型。
**参数:**
- `topology` - 图元拓扑类型(点、线、三角形等)
**示例:**
```cpp
cmdList->SetPrimitiveTopology(PrimitiveTopology::TriangleList);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,23 @@
# RHICommandList::SetRenderTargets
```cpp
virtual void SetRenderTargets(uint32_t count, void** renderTargets, void* depthStencil = nullptr) = 0;
```
设置渲染目标和深度模板缓冲区。
**参数:**
- `count` - 渲染目标数量
- `renderTargets` - 渲染目标数组
- `depthStencil` - 深度模板缓冲区(可选)
**示例:**
```cpp
void* targets[1] = {renderTarget};
cmdList->SetRenderTargets(1, targets, depthStencil);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,25 @@
# RHICommandList::SetScissorRect
```cpp
virtual void SetScissorRect(const Rect& rect) = 0;
```
设置裁剪矩形。
**参数:**
- `rect` - 裁剪矩形结构体
**示例:**
```cpp
Rect rect;
rect.left = 0;
rect.top = 0;
rect.right = 640;
rect.bottom = 480;
cmdList->SetScissorRect(rect);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,24 @@
# RHICommandList::SetScissorRects
```cpp
virtual void SetScissorRects(uint32_t count, const Rect* rects) = 0;
```
设置多个裁剪矩形。
**参数:**
- `count` - 裁剪矩形数量
- `rects` - 裁剪矩形数组指针
**示例:**
```cpp
Rect rects[2];
rects[0] = {0, 0, 640, 480};
rects[1] = {640, 0, 640, 480};
cmdList->SetScissorRects(2, rects);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,20 @@
# RHICommandList::SetStencilRef
```cpp
virtual void SetStencilRef(uint8_t ref) = 0;
```
设置模板参考值。
**参数:**
- `ref` - 模板参考值
**示例:**
```cpp
cmdList->SetStencilRef(0xFF);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,23 @@
# RHICommandList::SetVertexBuffer
```cpp
virtual void SetVertexBuffer(uint32_t slot, void* buffer, uint64_t offset, uint32_t stride) = 0;
```
设置顶点缓冲区。
**参数:**
- `slot` - 顶点缓冲区槽位
- `buffer` - 顶点缓冲区指针
- `offset` - 数据偏移量
- `stride` - 顶点步长
**示例:**
```cpp
cmdList->SetVertexBuffer(0, vertexBuffer, 0, sizeof(Vertex));
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,27 @@
# RHICommandList::SetVertexBuffers
```cpp
virtual void SetVertexBuffers(uint32_t startSlot, uint32_t count, const uint64_t* buffers, const uint64_t* offsets, const uint32_t* strides) = 0;
```
设置多个顶点缓冲区。
**参数:**
- `startSlot` - 起始槽位
- `count` - 缓冲区数量
- `buffers` - 缓冲区指针数组
- `offsets` - 偏移量数组
- `strides` - 步长数组
**示例:**
```cpp
uint64_t buffers[2] = {(uint64_t)vb1, (uint64_t)vb2};
uint64_t offsets[2] = {0, 0};
uint32_t strides[2] = {sizeof(Vertex), sizeof(Vertex)};
cmdList->SetVertexBuffers(0, 2, buffers, offsets, strides);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,27 @@
# RHICommandList::SetViewport
```cpp
virtual void SetViewport(const Viewport& viewport) = 0;
```
设置视口。
**参数:**
- `viewport` - 视口结构体
**示例:**
```cpp
Viewport vp;
vp.topLeftX = 0;
vp.topLeftY = 0;
vp.width = 1280;
vp.height = 720;
vp.minDepth = 0.0f;
vp.maxDepth = 1.0f;
cmdList->SetViewport(vp);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,24 @@
# RHICommandList::SetViewports
```cpp
virtual void SetViewports(uint32_t count, const Viewport* viewports) = 0;
```
设置多个视口。
**参数:**
- `count` - 视口数量
- `viewports` - 视口数组指针
**示例:**
```cpp
Viewport viewports[2];
viewports[0] = {0, 0, 640, 720, 0.0f, 1.0f};
viewports[1] = {640, 0, 640, 720, 0.0f, 1.0f};
cmdList->SetViewports(2, viewports);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,13 @@
# RHICommandList::Shutdown
```cpp
virtual void Shutdown() = 0;
```
关闭命令列表,释放所有相关资源。
**复杂度:** O(n) - 取决于管理的命令数量
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览

View File

@@ -0,0 +1,23 @@
# RHICommandList::TransitionBarrier
```cpp
virtual void TransitionBarrier(void* resource, ResourceStates stateBefore, ResourceStates stateAfter) = 0;
```
设置资源状态转换屏障,确保 GPU 资源在状态转换前完成所有操作。
**参数:**
- `resource` - 目标资源指针
- `stateBefore` - 转换前的资源状态
- `stateAfter` - 转换后的资源状态
**示例:**
```cpp
// 将纹理从渲染目标状态转换到着色器读取状态
cmdList->TransitionBarrier(texture, ResourceStates::RenderTarget, ResourceStates::ShaderResource);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览