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:
23
docs/api/rhi/opengl/command-list/clear-color.md
Normal file
23
docs/api/rhi/opengl/command-list/clear-color.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLCommandList::ClearColor
|
||||
|
||||
```cpp
|
||||
void ClearColor(float r, float g, float b, float a)
|
||||
```
|
||||
|
||||
清除颜色缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `r` - 红色分量 (0.0-1.0)
|
||||
- `g` - 绿色分量 (0.0-1.0)
|
||||
- `b` - 蓝色分量 (0.0-1.0)
|
||||
- `a` - 透明度分量 (0.0-1.0)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->ClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
22
docs/api/rhi/opengl/command-list/clear-depth-stencil.md
Normal file
22
docs/api/rhi/opengl/command-list/clear-depth-stencil.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLCommandList::ClearDepthStencil
|
||||
|
||||
```cpp
|
||||
void ClearDepthStencil(void* depthStencil, float depth, uint8_t stencil)
|
||||
```
|
||||
|
||||
清除深度模板目标。
|
||||
|
||||
**参数:**
|
||||
- `depthStencil` - 深度模板目标指针
|
||||
- `depth` - 深度值
|
||||
- `stencil` - 模板值
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->ClearDepthStencil(depthStencil, 1.0f, 0);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/command-list/clear-depth.md
Normal file
20
docs/api/rhi/opengl/command-list/clear-depth.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLCommandList::ClearDepth
|
||||
|
||||
```cpp
|
||||
void ClearDepth(float depth)
|
||||
```
|
||||
|
||||
清除深度缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `depth` - 深度值 (0.0-1.0)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->ClearDepth(1.0f);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
22
docs/api/rhi/opengl/command-list/clear-render-target.md
Normal file
22
docs/api/rhi/opengl/command-list/clear-render-target.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLCommandList::ClearRenderTarget
|
||||
|
||||
```cpp
|
||||
void ClearRenderTarget(void* renderTarget, const float color[4])
|
||||
```
|
||||
|
||||
清除渲染目标。
|
||||
|
||||
**参数:**
|
||||
- `renderTarget` - 渲染目标指针
|
||||
- `color` - 清除颜色 [r, g, b, a]
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
float color[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
commandList->ClearRenderTarget(renderTarget, color);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/command-list/clear-stencil.md
Normal file
20
docs/api/rhi/opengl/command-list/clear-stencil.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLCommandList::ClearStencil
|
||||
|
||||
```cpp
|
||||
void ClearStencil(int stencil)
|
||||
```
|
||||
|
||||
清除模板缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `stencil` - 模板值
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->ClearStencil(0);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
24
docs/api/rhi/opengl/command-list/clear.md
Normal file
24
docs/api/rhi/opengl/command-list/clear.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OpenGLCommandList::Clear
|
||||
|
||||
```cpp
|
||||
void Clear(float r, float g, float b, float a, unsigned int buffers);
|
||||
```
|
||||
|
||||
清除缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `r` - 红色分量
|
||||
- `g` - 绿色分量
|
||||
- `b` - 蓝色分量
|
||||
- `a` - Alpha 分量
|
||||
- `buffers` - 要清除的缓冲区标志
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f, Color | Depth);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList 总览](command-list.md) - 返回类总览
|
||||
44
docs/api/rhi/opengl/command-list/command-list.md
Normal file
44
docs/api/rhi/opengl/command-list/command-list.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# OpenGLCommandList
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: OpenGL 命令列表实现,继承自 `RHICommandList`。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭命令列表 |
|
||||
| [`Reset`](../../command-list/reset.md) | 重置命令列表 |
|
||||
| [`Close`](../../command-list/close.md) | 关闭命令列表 |
|
||||
| [`Clear`](clear.md) | 清除 |
|
||||
| [`ClearColor`](clear-color.md) | 清除颜色 |
|
||||
| [`ClearDepth`](clear-depth.md) | 清除深度 |
|
||||
| [`ClearStencil`](clear-stencil.md) | 清除模板 |
|
||||
| [`ClearDepthStencil`](clear-depth-stencil.md) | 清除深度模板 |
|
||||
| [`SetPipelineState`](set-pipeline-state.md) | 设置管线状态 |
|
||||
| [`SetVertexBuffer`](set-vertex-buffer.md) | 设置顶点缓冲 |
|
||||
| [`SetVertexBuffers`](set-vertex-buffers.md) | 设置多个顶点缓冲 |
|
||||
| [`SetIndexBuffer`](set-index-buffer.md) | 设置索引缓冲 |
|
||||
| [`TransitionBarrier`](transition-barrier.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) | 设置混合因子 |
|
||||
| [`ClearRenderTarget`](clear-render-target.md) | 清除渲染目标 |
|
||||
| [`Draw`](draw.md) | 绘制 |
|
||||
| [`DrawIndexed`](draw-indexed.md) | 索引绘制 |
|
||||
| [`Dispatch`](dispatch.md) | 分发计算任务 |
|
||||
| [`CopyResource`](copy-resource.md) | 复制资源 |
|
||||
| [`OpenGLMethods`](opengl-methods.md) | OpenGL 特有方法 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGL 后端总览](../overview.md)
|
||||
- [RHICommandList](../../command-list/command-list.md) - 抽象命令列表接口
|
||||
21
docs/api/rhi/opengl/command-list/copy-resource.md
Normal file
21
docs/api/rhi/opengl/command-list/copy-resource.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# OpenGLCommandList::CopyResource
|
||||
|
||||
```cpp
|
||||
void CopyResource(void* dst, void* src)
|
||||
```
|
||||
|
||||
复制资源。
|
||||
|
||||
**参数:**
|
||||
- `dst` - 目标资源指针
|
||||
- `src` - 源资源指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->CopyResource(dstTexture, srcTexture);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
22
docs/api/rhi/opengl/command-list/dispatch.md
Normal file
22
docs/api/rhi/opengl/command-list/dispatch.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLCommandList::Dispatch
|
||||
|
||||
```cpp
|
||||
void Dispatch(uint32_t x, uint32_t y, uint32_t z)
|
||||
```
|
||||
|
||||
分发计算着色器。
|
||||
|
||||
**参数:**
|
||||
- `x` - X 方向线程组数量
|
||||
- `y` - Y 方向线程组数量
|
||||
- `z` - Z 方向线程组数量
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->Dispatch(8, 8, 1);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
24
docs/api/rhi/opengl/command-list/draw-indexed.md
Normal file
24
docs/api/rhi/opengl/command-list/draw-indexed.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OpenGLCommandList::DrawIndexed
|
||||
|
||||
```cpp
|
||||
void DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t startIndex, int32_t baseVertex, uint32_t startInstance)
|
||||
```
|
||||
|
||||
绘制索引图元。
|
||||
|
||||
**参数:**
|
||||
- `indexCount` - 索引数量
|
||||
- `instanceCount` - 实例数量
|
||||
- `startIndex` - 起始索引
|
||||
- `baseVertex` - 基础顶点
|
||||
- `startInstance` - 起始实例
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->DrawIndexed(6, 1, 0, 0, 0);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
23
docs/api/rhi/opengl/command-list/draw.md
Normal file
23
docs/api/rhi/opengl/command-list/draw.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLCommandList::Draw
|
||||
|
||||
```cpp
|
||||
void Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t startVertex, uint32_t startInstance)
|
||||
```
|
||||
|
||||
绘制非索引图元。
|
||||
|
||||
**参数:**
|
||||
- `vertexCount` - 顶点数量
|
||||
- `instanceCount` - 实例数量
|
||||
- `startVertex` - 起始顶点
|
||||
- `startInstance` - 起始实例
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->Draw(3, 1, 0, 0);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
545
docs/api/rhi/opengl/command-list/opengl-methods.md
Normal file
545
docs/api/rhi/opengl/command-list/opengl-methods.md
Normal file
@@ -0,0 +1,545 @@
|
||||
# OpenGLCommandList - OpenGL 特有方法
|
||||
|
||||
以下是 `OpenGLCommandList` 中 OpenGL 特有的底层逃逸方法。这些方法不存在于 RHI 抽象接口中,用于需要直接操作 OpenGL 状态的高级场景。
|
||||
|
||||
## 顶点缓冲区(OpenGL 逃逸)
|
||||
|
||||
### SetVertexBuffer (GL uint)
|
||||
|
||||
```cpp
|
||||
void SetVertexBuffer(unsigned int buffer, size_t offset, size_t stride)
|
||||
```
|
||||
|
||||
直接使用 OpenGL buffer ID 设置顶点缓冲区。
|
||||
|
||||
### SetVertexBuffers (GL uint)
|
||||
|
||||
```cpp
|
||||
void SetVertexBuffers(unsigned int startSlot, unsigned int count, const unsigned int* buffers, const size_t* offsets, const size_t* strides)
|
||||
```
|
||||
|
||||
批量设置顶点缓冲区。
|
||||
|
||||
### SetIndexBuffer (GL uint)
|
||||
|
||||
```cpp
|
||||
void SetIndexBuffer(unsigned int buffer, unsigned int type)
|
||||
void SetIndexBuffer(unsigned int buffer, unsigned int type, size_t offset)
|
||||
```
|
||||
|
||||
直接设置索引缓冲区。
|
||||
|
||||
## 顶点数组
|
||||
|
||||
### BindVertexArray
|
||||
|
||||
```cpp
|
||||
void BindVertexArray(unsigned int vao)
|
||||
void BindVertexArray(unsigned int vao, unsigned int indexBuffer, unsigned int indexType)
|
||||
```
|
||||
|
||||
绑定 VAO,可同时设置索引缓冲区。
|
||||
|
||||
### UseShader
|
||||
|
||||
```cpp
|
||||
void UseShader(unsigned int program)
|
||||
```
|
||||
|
||||
使用 shader program。
|
||||
|
||||
## 视口与裁剪
|
||||
|
||||
### SetViewport (int)
|
||||
|
||||
```cpp
|
||||
void SetViewport(int x, int y, int width, int height)
|
||||
```
|
||||
|
||||
使用整数参数设置视口。
|
||||
|
||||
### SetViewport (float)
|
||||
|
||||
```cpp
|
||||
void SetViewport(float x, float y, float width, float height, float minDepth, float maxDepth)
|
||||
```
|
||||
|
||||
使用浮点参数设置视口。
|
||||
|
||||
### SetViewports
|
||||
|
||||
```cpp
|
||||
void SetViewports(unsigned int count, const float* viewports)
|
||||
```
|
||||
|
||||
批量设置视口(6 个浮点值 per viewport: x, y, width, height, minDepth, maxDepth)。
|
||||
|
||||
### SetScissor
|
||||
|
||||
```cpp
|
||||
void SetScissor(int x, int y, int width, int height)
|
||||
```
|
||||
|
||||
设置裁剪矩形。
|
||||
|
||||
### SetScissorRects
|
||||
|
||||
```cpp
|
||||
void SetScissorRects(unsigned int count, const int* rects)
|
||||
```
|
||||
|
||||
批量设置裁剪矩形(4 个整数值 per rect: x, y, width, height)。
|
||||
|
||||
### EnableScissorTest
|
||||
|
||||
```cpp
|
||||
void EnableScissorTest(bool enable)
|
||||
```
|
||||
|
||||
启用/禁用裁剪测试。
|
||||
|
||||
## 深度测试
|
||||
|
||||
### EnableDepthTest
|
||||
|
||||
```cpp
|
||||
void EnableDepthTest(bool enable)
|
||||
```
|
||||
|
||||
启用/禁用深度测试。
|
||||
|
||||
### EnableDepthWrite
|
||||
|
||||
```cpp
|
||||
void EnableDepthWrite(bool enable)
|
||||
```
|
||||
|
||||
启用/禁用深度写入。
|
||||
|
||||
### SetDepthFunc
|
||||
|
||||
```cpp
|
||||
void SetDepthFunc(unsigned int func)
|
||||
```
|
||||
|
||||
设置深度比较函数(GL_NEVER, GL_LESS, GL_EQUAL, etc.)。
|
||||
|
||||
## 模板测试
|
||||
|
||||
### EnableStencilTest
|
||||
|
||||
```cpp
|
||||
void EnableStencilTest(bool enable)
|
||||
```
|
||||
|
||||
启用/禁用模板测试。
|
||||
|
||||
### SetStencilFunc
|
||||
|
||||
```cpp
|
||||
void SetStencilFunc(unsigned int func, int ref, unsigned int mask)
|
||||
```
|
||||
|
||||
设置模板测试函数。
|
||||
|
||||
### SetStencilOp
|
||||
|
||||
```cpp
|
||||
void SetStencilOp(unsigned int fail, unsigned int zfail, unsigned int zpass)
|
||||
```
|
||||
|
||||
设置模板操作。
|
||||
|
||||
## 混合
|
||||
|
||||
### EnableBlending
|
||||
|
||||
```cpp
|
||||
void EnableBlending(bool enable)
|
||||
```
|
||||
|
||||
启用/禁用混合。
|
||||
|
||||
### SetBlendFunc
|
||||
|
||||
```cpp
|
||||
void SetBlendFunc(unsigned int src, unsigned int dst)
|
||||
```
|
||||
|
||||
设置混合函数。
|
||||
|
||||
### SetBlendFuncSeparate
|
||||
|
||||
```cpp
|
||||
void SetBlendFuncSeparate(unsigned int srcRGB, unsigned int dstRGB, unsigned int srcAlpha, unsigned int dstAlpha)
|
||||
```
|
||||
|
||||
分别设置 RGB 和 Alpha 的混合函数。
|
||||
|
||||
### SetBlendEquation
|
||||
|
||||
```cpp
|
||||
void SetBlendEquation(unsigned int mode)
|
||||
```
|
||||
|
||||
设置混合方程。
|
||||
|
||||
### SetBlendColor
|
||||
|
||||
```cpp
|
||||
void SetBlendColor(float r, float g, float b, float a)
|
||||
```
|
||||
|
||||
设置混合因子颜色。
|
||||
|
||||
## 光栅化
|
||||
|
||||
### EnableCulling
|
||||
|
||||
```cpp
|
||||
void EnableCulling(bool enable)
|
||||
```
|
||||
|
||||
启用/禁用面剔除。
|
||||
|
||||
### SetCullFace
|
||||
|
||||
```cpp
|
||||
void SetCullFace(unsigned int face)
|
||||
```
|
||||
|
||||
设置剔除面(GL_FRONT, GL_BACK, GL_FRONT_AND_BACK)。
|
||||
|
||||
### SetFrontFace
|
||||
|
||||
```cpp
|
||||
void SetFrontFace(unsigned int face)
|
||||
```
|
||||
|
||||
设置正面方向(GL_CW, GL_CCW)。
|
||||
|
||||
### SetPolygonMode
|
||||
|
||||
```cpp
|
||||
void SetPolygonMode(unsigned int mode)
|
||||
```
|
||||
|
||||
设置多边形模式(GL_POINT, GL_LINE, GL_FILL)。
|
||||
|
||||
### SetPolygonOffset
|
||||
|
||||
```cpp
|
||||
void SetPolygonOffset(float factor, float units)
|
||||
```
|
||||
|
||||
设置多边形偏移。
|
||||
|
||||
### SetPrimitiveType
|
||||
|
||||
```cpp
|
||||
void SetPrimitiveType(PrimitiveType type)
|
||||
```
|
||||
|
||||
设置图元类型。
|
||||
|
||||
## 绘制(OpenGL 类型)
|
||||
|
||||
### Draw (PrimitiveType)
|
||||
|
||||
```cpp
|
||||
void Draw(PrimitiveType type, unsigned int vertexCount, unsigned int startVertex)
|
||||
```
|
||||
|
||||
绘制非索引图元。
|
||||
|
||||
### DrawInstanced
|
||||
|
||||
```cpp
|
||||
void DrawInstanced(PrimitiveType type, unsigned int vertexCount, unsigned int instanceCount, unsigned int startVertex, unsigned int startInstance)
|
||||
```
|
||||
|
||||
实例化绘制。
|
||||
|
||||
### DrawIndexed (PrimitiveType)
|
||||
|
||||
```cpp
|
||||
void DrawIndexed(PrimitiveType type, unsigned int indexCount, unsigned int startIndex, int baseVertex)
|
||||
```
|
||||
|
||||
绘制索引图元。
|
||||
|
||||
### DrawIndexedInstanced
|
||||
|
||||
```cpp
|
||||
void DrawIndexedInstanced(PrimitiveType type, unsigned int indexCount, unsigned int instanceCount, unsigned int startIndex, int baseVertex, unsigned int startInstance)
|
||||
```
|
||||
|
||||
实例化索引绘制。
|
||||
|
||||
### DrawIndirect
|
||||
|
||||
```cpp
|
||||
void DrawIndirect(PrimitiveType type, unsigned int buffer, size_t offset, unsigned int drawCount, unsigned int stride)
|
||||
```
|
||||
|
||||
间接绘制。
|
||||
|
||||
### DrawIndexedIndirect
|
||||
|
||||
```cpp
|
||||
void DrawIndexedIndirect(PrimitiveType type, unsigned int buffer, size_t offset, unsigned int drawCount, unsigned int stride)
|
||||
```
|
||||
|
||||
间接索引绘制。
|
||||
|
||||
### MultiDrawArrays
|
||||
|
||||
```cpp
|
||||
void MultiDrawArrays(PrimitiveType type, const int* first, const int* count, unsigned int drawCount)
|
||||
```
|
||||
|
||||
多重绘制。
|
||||
|
||||
### MultiDrawElements
|
||||
|
||||
```cpp
|
||||
void MultiDrawElements(PrimitiveType type, const int* count, unsigned int type_, const void* const* indices, unsigned int drawCount)
|
||||
```
|
||||
|
||||
多重索引绘制。
|
||||
|
||||
## 计算着色器
|
||||
|
||||
### DispatchIndirect
|
||||
|
||||
```cpp
|
||||
void DispatchIndirect(unsigned int buffer, size_t offset)
|
||||
```
|
||||
|
||||
间接分发计算着色器。
|
||||
|
||||
### DispatchCompute
|
||||
|
||||
```cpp
|
||||
void DispatchCompute(unsigned int x, unsigned int y, unsigned int z, unsigned int groupX, unsigned int groupY, unsigned int groupZ)
|
||||
```
|
||||
|
||||
分发计算着色器(带参数)。
|
||||
|
||||
## 内存屏障
|
||||
|
||||
### MemoryBarrier
|
||||
|
||||
```cpp
|
||||
void MemoryBarrier(unsigned int barriers)
|
||||
```
|
||||
|
||||
设置内存屏障。
|
||||
|
||||
### TextureBarrier
|
||||
|
||||
```cpp
|
||||
void TextureBarrier()
|
||||
```
|
||||
|
||||
纹理屏障。
|
||||
|
||||
## 纹理绑定
|
||||
|
||||
### BindTexture
|
||||
|
||||
```cpp
|
||||
void BindTexture(unsigned int target, unsigned int unit, unsigned int texture)
|
||||
```
|
||||
|
||||
绑定纹理到纹理单元。
|
||||
|
||||
### BindTextures
|
||||
|
||||
```cpp
|
||||
void BindTextures(unsigned int first, unsigned int count, const unsigned int* textures)
|
||||
```
|
||||
|
||||
批量绑定纹理。
|
||||
|
||||
### BindSampler
|
||||
|
||||
```cpp
|
||||
void BindSampler(unsigned int unit, unsigned int sampler)
|
||||
```
|
||||
|
||||
绑定采样器。
|
||||
|
||||
### BindSamplers
|
||||
|
||||
```cpp
|
||||
void BindSamplers(unsigned int first, unsigned int count, const unsigned int* samplers)
|
||||
```
|
||||
|
||||
批量绑定采样器。
|
||||
|
||||
### BindImageTexture
|
||||
|
||||
```cpp
|
||||
void BindImageTexture(unsigned int unit, unsigned int texture, int level, bool layered, int layer, unsigned int access, unsigned int format)
|
||||
```
|
||||
|
||||
绑定为 image texture。
|
||||
|
||||
## 缓冲区绑定
|
||||
|
||||
### BindBufferBase
|
||||
|
||||
```cpp
|
||||
void BindBufferBase(unsigned int target, unsigned int index, unsigned int buffer)
|
||||
```
|
||||
|
||||
绑定到固定 binding point。
|
||||
|
||||
### BindBufferRange
|
||||
|
||||
```cpp
|
||||
void BindBufferRange(unsigned int target, unsigned int index, unsigned int buffer, size_t offset, size_t size)
|
||||
```
|
||||
|
||||
绑定到范围 binding point。
|
||||
|
||||
## OpenGL 状态
|
||||
|
||||
### Enable / Disable
|
||||
|
||||
```cpp
|
||||
void Enable(unsigned int cap)
|
||||
void Disable(unsigned int cap)
|
||||
void Enablei(unsigned int cap, unsigned int index)
|
||||
void Disablei(unsigned int cap, unsigned int index)
|
||||
```
|
||||
|
||||
启用/禁用 GL capability。
|
||||
|
||||
## Uniform 设置
|
||||
|
||||
### SetUniform1i / SetUniform1f
|
||||
|
||||
```cpp
|
||||
void SetUniform1i(int location, int v)
|
||||
void SetUniform1f(int location, float v)
|
||||
```
|
||||
|
||||
### SetUniform2f
|
||||
|
||||
```cpp
|
||||
void SetUniform2f(int location, float x, float y)
|
||||
```
|
||||
|
||||
### SetUniform3f
|
||||
|
||||
```cpp
|
||||
void SetUniform3f(int location, float x, float y, float z)
|
||||
```
|
||||
|
||||
### SetUniform4f
|
||||
|
||||
```cpp
|
||||
void SetUniform4f(int location, float x, float y, float z, float w)
|
||||
```
|
||||
|
||||
### SetUniform1fv / SetUniform2fv / SetUniform3fv / SetUniform4fv
|
||||
|
||||
```cpp
|
||||
void SetUniform1fv(int location, int count, const float* v)
|
||||
void SetUniform2fv(int location, int count, const float* v)
|
||||
void SetUniform3fv(int location, int count, const float* v)
|
||||
void SetUniform4fv(int location, int count, const float* v)
|
||||
```
|
||||
|
||||
### SetUniformMatrix4fv
|
||||
|
||||
```cpp
|
||||
void SetUniformMatrix4fv(int location, int count, bool transpose, const float* v)
|
||||
```
|
||||
|
||||
## Shader 程序
|
||||
|
||||
### UseProgram
|
||||
|
||||
```cpp
|
||||
void UseProgram(unsigned int program)
|
||||
```
|
||||
|
||||
使用 program。
|
||||
|
||||
### BindFragDataLocation
|
||||
|
||||
```cpp
|
||||
void BindFragDataLocation(unsigned int program, unsigned int colorNumber, const char* name)
|
||||
void BindFragDataLocationIndexed(unsigned int program, unsigned int colorNumber, unsigned int index, const char* name)
|
||||
```
|
||||
|
||||
设置颜色输出绑定。
|
||||
|
||||
## 查询
|
||||
|
||||
### BeginQuery / EndQuery
|
||||
|
||||
```cpp
|
||||
void BeginQuery(unsigned int target, unsigned int id)
|
||||
void EndQuery(unsigned int target)
|
||||
```
|
||||
|
||||
开始/结束查询。
|
||||
|
||||
### GetQueryObjectiv / GetQueryObjectuiv
|
||||
|
||||
```cpp
|
||||
void GetQueryObjectiv(unsigned int id, unsigned int pname, int* params)
|
||||
void GetQueryObjectuiv(unsigned int id, unsigned int pname, unsigned int* params)
|
||||
```
|
||||
|
||||
获取查询结果。
|
||||
|
||||
## Framebuffer 操作
|
||||
|
||||
### ReadPixels
|
||||
|
||||
```cpp
|
||||
void ReadPixels(int x, int y, int width, int height, unsigned int format, unsigned int type, void* data)
|
||||
```
|
||||
|
||||
读取像素。
|
||||
|
||||
### BlitFramebuffer
|
||||
|
||||
```cpp
|
||||
void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, unsigned int mask, unsigned int filter)
|
||||
```
|
||||
|
||||
Blit 帧缓冲区。
|
||||
|
||||
### CopyImageSubData
|
||||
|
||||
```cpp
|
||||
void CopyImageSubData(unsigned int srcName, unsigned int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, unsigned int dstName, unsigned int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth)
|
||||
```
|
||||
|
||||
复制图像子数据。
|
||||
|
||||
### InvalidateFramebuffer
|
||||
|
||||
```cpp
|
||||
void InvalidateFramebuffer(unsigned int target, unsigned int count, const unsigned int* attachments)
|
||||
void InvalidateSubFramebuffer(unsigned int target, unsigned int count, const unsigned int* attachments, int x, int y, int width, int height)
|
||||
```
|
||||
|
||||
使帧缓冲区失效。
|
||||
|
||||
## 调试
|
||||
|
||||
### PushDebugGroup / PopDebugGroup
|
||||
|
||||
```cpp
|
||||
void PushDebugGroup(unsigned int source, unsigned int id, int length, const char* message)
|
||||
void PopDebugGroup()
|
||||
```
|
||||
|
||||
推送/弹出调试组。
|
||||
21
docs/api/rhi/opengl/command-list/set-blend-factor.md
Normal file
21
docs/api/rhi/opengl/command-list/set-blend-factor.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# OpenGLCommandList::SetBlendFactor
|
||||
|
||||
```cpp
|
||||
void SetBlendFactor(const float factor[4])
|
||||
```
|
||||
|
||||
设置混合因子。
|
||||
|
||||
**参数:**
|
||||
- `factor` - 混合因子数组 [r, g, b, a]
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
float factor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
commandList->SetBlendFactor(factor);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
24
docs/api/rhi/opengl/command-list/set-blend-state.md
Normal file
24
docs/api/rhi/opengl/command-list/set-blend-state.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OpenGLCommandList::SetBlendState
|
||||
|
||||
```cpp
|
||||
void SetBlendState(const BlendState& state)
|
||||
```
|
||||
|
||||
设置混合状态。
|
||||
|
||||
**参数:**
|
||||
- `state` - 混合状态结构
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
BlendState state;
|
||||
state.enable = true;
|
||||
state.srcBlend = BlendFunc::SrcAlpha;
|
||||
state.dstBlend = BlendFunc::InvSrcAlpha;
|
||||
commandList->SetBlendState(state);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
24
docs/api/rhi/opengl/command-list/set-depth-stencil-state.md
Normal file
24
docs/api/rhi/opengl/command-list/set-depth-stencil-state.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OpenGLCommandList::SetDepthStencilState
|
||||
|
||||
```cpp
|
||||
void SetDepthStencilState(const DepthStencilState& state)
|
||||
```
|
||||
|
||||
设置深度模板状态。
|
||||
|
||||
**参数:**
|
||||
- `state` - 深度模板状态结构
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
DepthStencilState state;
|
||||
state.depthEnable = true;
|
||||
state.depthWriteEnable = true;
|
||||
state.depthFunc = ComparisonFunc::Less;
|
||||
commandList->SetDepthStencilState(state);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
22
docs/api/rhi/opengl/command-list/set-index-buffer.md
Normal file
22
docs/api/rhi/opengl/command-list/set-index-buffer.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLCommandList::SetIndexBuffer
|
||||
|
||||
```cpp
|
||||
void SetIndexBuffer(void* buffer, uint64_t offset, Format format)
|
||||
```
|
||||
|
||||
设置索引缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `buffer` - 缓冲区指针
|
||||
- `offset` - 数据偏移
|
||||
- `format` - 索引格式
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->SetIndexBuffer(indexBuffer, 0, Format::R32_UINT);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/command-list/set-pipeline-state.md
Normal file
20
docs/api/rhi/opengl/command-list/set-pipeline-state.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLCommandList::SetPipelineState
|
||||
|
||||
```cpp
|
||||
void SetPipelineState(void* pipelineState)
|
||||
```
|
||||
|
||||
设置渲染管线状态。
|
||||
|
||||
**参数:**
|
||||
- `pipelineState` - 管线状态对象指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->SetPipelineState(pipelineState);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/command-list/set-primitive-topology.md
Normal file
20
docs/api/rhi/opengl/command-list/set-primitive-topology.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLCommandList::SetPrimitiveTopology
|
||||
|
||||
```cpp
|
||||
void SetPrimitiveTopology(PrimitiveTopology topology)
|
||||
```
|
||||
|
||||
设置图元拓扑类型。
|
||||
|
||||
**参数:**
|
||||
- `topology` - 图元拓扑类型
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->SetPrimitiveTopology(PrimitiveTopology::TriangleList);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
23
docs/api/rhi/opengl/command-list/set-render-targets.md
Normal file
23
docs/api/rhi/opengl/command-list/set-render-targets.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLCommandList::SetRenderTargets
|
||||
|
||||
```cpp
|
||||
void SetRenderTargets(uint32_t count, void** renderTargets, void* depthStencil = nullptr)
|
||||
```
|
||||
|
||||
设置渲染目标。
|
||||
|
||||
**参数:**
|
||||
- `count` - 渲染目标数量
|
||||
- `renderTargets` - 渲染目标指针数组
|
||||
- `depthStencil` - 深度模板缓冲区指针(可选)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
void* targets[1] = { colorTarget };
|
||||
commandList->SetRenderTargets(1, targets, depthStencil);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
23
docs/api/rhi/opengl/command-list/set-scissor-rect.md
Normal file
23
docs/api/rhi/opengl/command-list/set-scissor-rect.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLCommandList::SetScissorRect
|
||||
|
||||
```cpp
|
||||
void SetScissorRect(const Rect& rect)
|
||||
```
|
||||
|
||||
设置裁剪矩形。
|
||||
|
||||
**参数:**
|
||||
- `rect` - 裁剪矩形结构
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Rect rect;
|
||||
rect.x = 0; rect.y = 0;
|
||||
rect.width = 800; rect.height = 600;
|
||||
commandList->SetScissorRect(rect);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
22
docs/api/rhi/opengl/command-list/set-scissor-rects.md
Normal file
22
docs/api/rhi/opengl/command-list/set-scissor-rects.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLCommandList::SetScissorRects
|
||||
|
||||
```cpp
|
||||
void SetScissorRects(uint32_t count, const Rect* rects)
|
||||
```
|
||||
|
||||
批量设置裁剪矩形。
|
||||
|
||||
**参数:**
|
||||
- `count` - 裁剪矩形数量
|
||||
- `rects` - 裁剪矩形数组指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Rect rects[2] = { ... };
|
||||
commandList->SetScissorRects(2, rects);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/command-list/set-stencil-ref.md
Normal file
20
docs/api/rhi/opengl/command-list/set-stencil-ref.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLCommandList::SetStencilRef
|
||||
|
||||
```cpp
|
||||
void SetStencilRef(uint8_t ref)
|
||||
```
|
||||
|
||||
设置模板测试参考值。
|
||||
|
||||
**参数:**
|
||||
- `ref` - 模板参考值
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->SetStencilRef(1);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
23
docs/api/rhi/opengl/command-list/set-vertex-buffer.md
Normal file
23
docs/api/rhi/opengl/command-list/set-vertex-buffer.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLCommandList::SetVertexBuffer
|
||||
|
||||
```cpp
|
||||
void SetVertexBuffer(uint32_t slot, void* buffer, uint64_t offset, uint32_t stride)
|
||||
```
|
||||
|
||||
设置单个顶点缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `slot` - 顶点缓冲区槽位
|
||||
- `buffer` - 缓冲区指针
|
||||
- `offset` - 数据偏移
|
||||
- `stride` - 顶点跨度
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->SetVertexBuffer(0, vertexBuffer, 0, sizeof(Vertex));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
24
docs/api/rhi/opengl/command-list/set-vertex-buffers.md
Normal file
24
docs/api/rhi/opengl/command-list/set-vertex-buffers.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OpenGLCommandList::SetVertexBuffers
|
||||
|
||||
```cpp
|
||||
void SetVertexBuffers(uint32_t startSlot, uint32_t count, const uint64_t* buffers, const uint64_t* offsets, const uint32_t* strides)
|
||||
```
|
||||
|
||||
批量设置顶点缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `startSlot` - 起始槽位
|
||||
- `count` - 缓冲区数量
|
||||
- `buffers` - 缓冲区指针数组
|
||||
- `offsets` - 偏移数组
|
||||
- `strides` - 跨度数组
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->SetVertexBuffers(0, 2, buffers, offsets, strides);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
24
docs/api/rhi/opengl/command-list/set-viewport.md
Normal file
24
docs/api/rhi/opengl/command-list/set-viewport.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OpenGLCommandList::SetViewport
|
||||
|
||||
```cpp
|
||||
void SetViewport(const Viewport& viewport)
|
||||
```
|
||||
|
||||
设置视口。
|
||||
|
||||
**参数:**
|
||||
- `viewport` - 视口结构
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Viewport viewport;
|
||||
viewport.x = 0; viewport.y = 0;
|
||||
viewport.width = 800; viewport.height = 600;
|
||||
viewport.minDepth = 0.0f; viewport.maxDepth = 1.0f;
|
||||
commandList->SetViewport(viewport);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
22
docs/api/rhi/opengl/command-list/set-viewports.md
Normal file
22
docs/api/rhi/opengl/command-list/set-viewports.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLCommandList::SetViewports
|
||||
|
||||
```cpp
|
||||
void SetViewports(uint32_t count, const Viewport* viewports)
|
||||
```
|
||||
|
||||
批量设置视口。
|
||||
|
||||
**参数:**
|
||||
- `count` - 视口数量
|
||||
- `viewports` - 视口数组指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Viewport viewports[2] = { ... };
|
||||
commandList->SetViewports(2, viewports);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
22
docs/api/rhi/opengl/command-list/transition-barrier.md
Normal file
22
docs/api/rhi/opengl/command-list/transition-barrier.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLCommandList::TransitionBarrier
|
||||
|
||||
```cpp
|
||||
void TransitionBarrier(void* resource, ResourceStates stateBefore, ResourceStates stateAfter)
|
||||
```
|
||||
|
||||
设置资源状态转换屏障。
|
||||
|
||||
**参数:**
|
||||
- `resource` - 资源指针
|
||||
- `stateBefore` - 转换前状态
|
||||
- `stateAfter` - 转换后状态
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
commandList->TransitionBarrier(texture, ResourceStates::RenderTarget, ResourceStates::Common);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLCommandList](command-list.md) - 返回类总览
|
||||
Reference in New Issue
Block a user