docs(api): fill OpenGL command list passthrough docs

This commit is contained in:
2026-03-28 02:28:46 +08:00
parent 94795cb34d
commit 4a12e26860
46 changed files with 423 additions and 924 deletions

View File

@@ -1,32 +1,24 @@
# OpenGLCommandList::BeginQuery
公开方法,详见头文件声明。
# OpenGLCommandList::BeginQuery()
```cpp
void BeginQuery(unsigned int target, unsigned int id);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `target` - 参数语义详见头文件声明。
- `id` - 参数语义详见头文件声明。
开始一次 OpenGL query。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BeginQuery(...)。
(void)object;
}
glBeginQuery(target, id);
```
## 需要注意
- 这是原生直通包装,不检查 query 是否已开始。
- `target``id` 的合法性完全由调用方负责。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [EndQuery](EndQuery.md)

View File

@@ -1,33 +1,19 @@
# OpenGLCommandList::BindBufferBase
公开方法,详见头文件声明。
# OpenGLCommandList::BindBufferBase()
```cpp
void BindBufferBase(unsigned int target, unsigned int index, unsigned int buffer);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `target` - 参数语义详见头文件声明。
- `index` - 参数语义详见头文件声明。
- `buffer` - 参数语义详见头文件声明。
把 buffer 绑定到某个 indexed target。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindBufferBase(...)。
(void)object;
}
glBindBufferBase(target, index, buffer);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindBufferRange](BindBufferRange.md)

View File

@@ -1,35 +1,24 @@
# OpenGLCommandList::BindBufferRange
公开方法,详见头文件声明。
# OpenGLCommandList::BindBufferRange()
```cpp
void BindBufferRange(unsigned int target, unsigned int index, unsigned int buffer, size_t offset, size_t size);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `target` - 参数语义详见头文件声明。
- `index` - 参数语义详见头文件声明。
- `buffer` - 参数语义详见头文件声明。
- `offset` - 参数语义详见头文件声明。
- `size` - 参数语义详见头文件声明。
把 buffer 的一个范围绑定到 indexed target。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindBufferRange(...)。
(void)object;
}
glBindBufferRange(target, index, buffer, offset, size);
```
## 需要注意
- 不做对齐或越界检查。
- `offset` / `size` 的合法性完全依赖调用方。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindBufferBase](BindBufferBase.md)

View File

@@ -1,33 +1,23 @@
# OpenGLCommandList::BindFragDataLocation
公开方法,详见头文件声明。
# OpenGLCommandList::BindFragDataLocation()
```cpp
void BindFragDataLocation(unsigned int program, unsigned int colorNumber, const char* name);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `program` - 参数语义详见头文件声明。
- `colorNumber` - 参数语义详见头文件声明。
- `name` - 参数语义详见头文件声明。
为片元着色器输出变量指定颜色附件位置。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindFragDataLocation(...)。
(void)object;
}
glBindFragDataLocation(program, colorNumber, name);
```
## 需要注意
按照 OpenGL 规范,这类绑定通常应在 program link 之前设置。当前封装不检查 program 当前状态。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindFragDataLocationIndexed](BindFragDataLocationIndexed.md)

View File

@@ -1,34 +1,19 @@
# OpenGLCommandList::BindFragDataLocationIndexed
公开方法,详见头文件声明。
# OpenGLCommandList::BindFragDataLocationIndexed()
```cpp
void BindFragDataLocationIndexed(unsigned int program, unsigned int colorNumber, unsigned int index, const char* name);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `program` - 参数语义详见头文件声明。
- `colorNumber` - 参数语义详见头文件声明。
- `index` - 参数语义详见头文件声明。
- `name` - 参数语义详见头文件声明。
为片元输出指定颜色编号和 dual-source 索引。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindFragDataLocationIndexed(...)。
(void)object;
}
glBindFragDataLocationIndexed(program, colorNumber, index, name);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindFragDataLocation](BindFragDataLocation.md)

View File

@@ -1,37 +1,24 @@
# OpenGLCommandList::BindImageTexture
公开方法,详见头文件声明。
# OpenGLCommandList::BindImageTexture()
```cpp
void BindImageTexture(unsigned int unit, unsigned int texture, int level, bool layered, int layer, unsigned int access, unsigned int format);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `unit` - 参数语义详见头文件声明。
- `texture` - 参数语义详见头文件声明。
- `level` - 参数语义详见头文件声明。
- `layered` - 参数语义详见头文件声明。
- `layer` - 参数语义详见头文件声明。
- `access` - 参数语义详见头文件声明。
- `format` - 参数语义详见头文件声明。
把纹理作为 image 绑定到指定 image unit。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindImageTexture(...)。
(void)object;
}
glBindImageTexture(unit, texture, level, layered ? GL_TRUE : GL_FALSE, layer, access, format);
```
## 需要注意
- 这是完全原生参数透传,不会根据 `OpenGLTexture``OpenGLResourceView` 自动推导格式、层级或访问权限。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindTexture](BindTexture.md)
- [OpenGLResourceView](../OpenGLResourceView/OpenGLResourceView.md)

View File

@@ -1,32 +1,19 @@
# OpenGLCommandList::BindSampler
公开方法,详见头文件声明。
# OpenGLCommandList::BindSampler()
```cpp
void BindSampler(unsigned int unit, unsigned int sampler);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `unit` - 参数语义详见头文件声明。
- `sampler` - 参数语义详见头文件声明。
把 sampler 绑定到指定纹理单元。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindSampler(...)。
(void)object;
}
glBindSampler(unit, sampler);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindSamplers](BindSamplers.md)

View File

@@ -1,33 +1,19 @@
# OpenGLCommandList::BindSamplers
公开方法,详见头文件声明。
# OpenGLCommandList::BindSamplers()
```cpp
void BindSamplers(unsigned int first, unsigned int count, const unsigned int* samplers);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `first` - 参数语义详见头文件声明。
- `count` - 参数语义详见头文件声明。
- `samplers` - 参数语义详见头文件声明。
批量绑定 sampler。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindSamplers(...)。
(void)object;
}
glBindSamplers(first, count, samplers);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindSampler](BindSampler.md)

View File

@@ -1,33 +1,27 @@
# OpenGLCommandList::BindTexture
公开方法,详见头文件声明。
# OpenGLCommandList::BindTexture()
```cpp
void BindTexture(unsigned int target, unsigned int unit, unsigned int texture);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `target` - 参数语义详见头文件声明。
- `unit` - 参数语义详见头文件声明。
- `texture` - 参数语义详见头文件声明。
把纹理绑定到指定 texture unit。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
函数会先切换 active texture unit再绑定纹理:
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindTexture(...)。
(void)object;
}
glActiveTexture(GL_TEXTURE0 + unit);
glBindTexture(target, texture);
```
## 需要注意
- 会修改当前 active texture unit。
- 不会恢复调用前的 active unit。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindTextures](BindTextures.md)

View File

@@ -1,33 +1,19 @@
# OpenGLCommandList::BindTextures
公开方法,详见头文件声明。
# OpenGLCommandList::BindTextures()
```cpp
void BindTextures(unsigned int first, unsigned int count, const unsigned int* textures);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `first` - 参数语义详见头文件声明。
- `count` - 参数语义详见头文件声明。
- `textures` - 参数语义详见头文件声明。
批量绑定一段连续的 texture unit。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindTextures(...)。
(void)object;
}
glBindTextures(first, count, textures);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BindTexture](BindTexture.md)

View File

@@ -1,46 +1,33 @@
# OpenGLCommandList::BindVertexArray
公开方法,详见头文件声明。
该方法在 `XCEngine/RHI/OpenGL/OpenGLCommandList.h` 中提供了 2 个重载,当前页面统一汇总这些公开声明。
## 重载 1: 声明
# OpenGLCommandList::BindVertexArray()
```cpp
void BindVertexArray(unsigned int vao);
```
**参数:**
- `vao` - 参数语义详见头文件声明。
**返回:** `void` - 无返回值。
## 重载 2: 声明
```cpp
void BindVertexArray(unsigned int vao, unsigned int indexBuffer, unsigned int indexType);
```
**参数:**
- `vao` - 参数语义详见头文件声明。
- `indexBuffer` - 参数语义详见头文件声明。
- `indexType` - 参数语义详见头文件声明。
## 作用
**返回:** `void` - 无返回值
绑定 VAO并在需要时同时配置索引缓冲上下文
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
### `BindVertexArray(unsigned int vao)`
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BindVertexArray(...)。
(void)object;
}
```
- `m_currentVAO = vao`
- `glBindVertexArray(vao)`
### `BindVertexArray(unsigned int vao, unsigned int indexBuffer, unsigned int indexType)`
- `m_currentVAO = vao`
- `glBindVertexArray(vao)`
- `glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer)`
- `m_currentIndexType = indexType`
- `m_currentIndexOffset = 0`
## 需要注意
第二个重载会更新命令列表内部缓存的索引类型与偏移,这会直接影响后续 [DrawIndexedInstanced](DrawIndexedInstanced.md) 和 [DrawIndexedIndirect](DrawIndexedIndirect.md)。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [SetIndexBuffer](SetIndexBuffer.md)

View File

@@ -1,40 +1,23 @@
# OpenGLCommandList::BlitFramebuffer
公开方法,详见头文件声明。
# OpenGLCommandList::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);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `srcX0` - 参数语义详见头文件声明。
- `srcY0` - 参数语义详见头文件声明。
- `srcX1` - 参数语义详见头文件声明。
- `srcY1` - 参数语义详见头文件声明。
- `dstX0` - 参数语义详见头文件声明。
- `dstY0` - 参数语义详见头文件声明。
- `dstX1` - 参数语义详见头文件声明。
- `dstY1` - 参数语义详见头文件声明。
- `mask` - 参数语义详见头文件声明。
- `filter` - 参数语义详见头文件声明。
执行 framebuffer blit。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::BlitFramebuffer(...)。
(void)object;
}
glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
```
## 需要注意
调用前必须由外部正确设置读/写 framebuffer 绑定。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [ReadPixels](ReadPixels.md)

View File

@@ -1,30 +1,22 @@
# OpenGLCommandList::Close
公开方法,详见头文件声明。
# OpenGLCommandList::Close()
```cpp
void Close() override;
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
结束命令列表录制
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
当前实现为空函数,没有任何状态提交、校验或冻结逻辑。
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
## 工程含义
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::Close(...)。
(void)object;
}
```
这再次说明 `OpenGLCommandList` 不是可延迟提交的录制型命令缓冲,而更接近即时执行 facade。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Reset](Reset.md)
- [OpenGLCommandList](OpenGLCommandList.md)

View File

@@ -1,45 +1,21 @@
# OpenGLCommandList::CopyImageSubData
公开方法,详见头文件声明。
# OpenGLCommandList::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);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `srcName` - 参数语义详见头文件声明。
- `srcTarget` - 参数语义详见头文件声明。
- `srcLevel` - 参数语义详见头文件声明。
- `srcX` - 参数语义详见头文件声明。
- `srcY` - 参数语义详见头文件声明。
- `srcZ` - 参数语义详见头文件声明。
- `dstName` - 参数语义详见头文件声明。
- `dstTarget` - 参数语义详见头文件声明。
- `dstLevel` - 参数语义详见头文件声明。
- `dstX` - 参数语义详见头文件声明。
- `dstY` - 参数语义详见头文件声明。
- `dstZ` - 参数语义详见头文件声明。
- `width` - 参数语义详见头文件声明。
- `height` - 参数语义详见头文件声明。
- `depth` - 参数语义详见头文件声明。
执行纹理到纹理的子区域复制。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
实现直接透传到:
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::CopyImageSubData(...)。
(void)object;
}
glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [CopyResource](CopyResource.md)

View File

@@ -1,31 +1,20 @@
# OpenGLCommandList::Disable
公开方法,详见头文件声明。
# OpenGLCommandList::Disable()
```cpp
void Disable(unsigned int cap);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `cap` - 参数语义详见头文件声明。
关闭一个全局 OpenGL capability。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::Disable(...)。
(void)object;
}
glDisable(cap);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Enable](Enable.md)
- [Disablei](Disablei.md)

View File

@@ -1,32 +1,20 @@
# OpenGLCommandList::Disablei
公开方法,详见头文件声明。
# OpenGLCommandList::Disablei()
```cpp
void Disablei(unsigned int cap, unsigned int index);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `cap` - 参数语义详见头文件声明。
- `index` - 参数语义详见头文件声明。
关闭某个带索引的 capability。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::Disablei(...)。
(void)object;
}
glDisablei(cap, index);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Enablei](Enablei.md)
- [Disable](Disable.md)

View File

@@ -1,33 +1,24 @@
# OpenGLCommandList::DispatchCompute
公开方法,详见头文件声明。
# OpenGLCommandList::DispatchCompute()
```cpp
void DispatchCompute(unsigned int x, unsigned int y, unsigned int z);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `x` - 参数语义详见头文件声明。
- `y` - 参数语义详见头文件声明。
- `z` - 参数语义详见头文件声明。
发起一次计算着色器 dispatch。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::DispatchCompute(...)。
(void)object;
}
glDispatchCompute(x, y, z);
```
## 需要注意
它和跨后端覆盖方法 [Dispatch](Dispatch.md) 在当前实现上等价。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Dispatch](Dispatch.md)
- [DispatchIndirect](DispatchIndirect.md)

View File

@@ -1,32 +1,21 @@
# OpenGLCommandList::DispatchIndirect
公开方法,详见头文件声明。
# OpenGLCommandList::DispatchIndirect()
```cpp
void DispatchIndirect(unsigned int buffer, size_t offset);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `buffer` - 参数语义详见头文件声明。
- `offset` - 参数语义详见头文件声明。
从间接参数缓冲发起计算 dispatch。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
函数会:
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::DispatchIndirect(...)。
(void)object;
}
```
1. `glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, buffer)`
2. `glDispatchComputeIndirect((GLintptr)offset)`
3. `glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, 0)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [DispatchCompute](DispatchCompute.md)

View File

@@ -1,35 +1,26 @@
# OpenGLCommandList::DrawIndexedIndirect
公开方法,详见头文件声明。
# OpenGLCommandList::DrawIndexedIndirect()
```cpp
void DrawIndexedIndirect(PrimitiveType type, unsigned int buffer, size_t offset, unsigned int drawCount, unsigned int stride);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `type` - 参数语义详见头文件声明。
- `buffer` - 参数语义详见头文件声明。
- `offset` - 参数语义详见头文件声明。
- `drawCount` - 参数语义详见头文件声明。
- `stride` - 参数语义详见头文件声明。
执行一次索引间接绘制。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
- 先把 `m_primitiveType` 更新为 `ToOpenGL(type)`
- 绑定 `GL_DRAW_INDIRECT_BUFFER`
- 调用 `glDrawElementsIndirect(m_primitiveType, m_currentIndexType, (void*)offset)`
- 解绑 `GL_DRAW_INDIRECT_BUFFER`
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
## 需要注意
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::DrawIndexedIndirect(...)。
(void)object;
}
```
- `drawCount``stride` 当前被忽略。
- 使用的索引类型来自命令列表缓存的 `m_currentIndexType`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [DrawIndirect](DrawIndirect.md)
- [BindVertexArray](BindVertexArray.md)

View File

@@ -1,36 +1,25 @@
# OpenGLCommandList::DrawIndexedInstanced
公开方法,详见头文件声明。
# OpenGLCommandList::DrawIndexedInstanced()
```cpp
void DrawIndexedInstanced(PrimitiveType type, unsigned int indexCount, unsigned int instanceCount, unsigned int startIndex, int baseVertex, unsigned int startInstance);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `type` - 参数语义详见头文件声明。
- `indexCount` - 参数语义详见头文件声明。
- `instanceCount` - 参数语义详见头文件声明。
- `startIndex` - 参数语义详见头文件声明。
- `baseVertex` - 参数语义详见头文件声明。
- `startInstance` - 参数语义详见头文件声明。
执行一次带实例化的索引绘制。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
- 更新 `m_primitiveType = ToOpenGL(type)`
- 根据 `m_currentIndexOffset + startIndex * indexTypeSize` 计算索引起始地址
- 调用 `glDrawElementsInstanced(...)`
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
## 需要注意
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::DrawIndexedInstanced(...)。
(void)object;
}
```
- `baseVertex` 当前被忽略。
- `startInstance` 当前被忽略。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [DrawIndexed](DrawIndexed.md)
- [DrawIndexedIndirect](DrawIndexedIndirect.md)

View File

@@ -1,35 +1,24 @@
# OpenGLCommandList::DrawIndirect
公开方法,详见头文件声明。
# OpenGLCommandList::DrawIndirect()
```cpp
void DrawIndirect(PrimitiveType type, unsigned int buffer, size_t offset, unsigned int drawCount, unsigned int stride);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `type` - 参数语义详见头文件声明。
- `buffer` - 参数语义详见头文件声明。
- `offset` - 参数语义详见头文件声明。
- `drawCount` - 参数语义详见头文件声明。
- `stride` - 参数语义详见头文件声明。
执行一次非索引间接绘制。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
- 先更新 `m_primitiveType`
- 绑定 `GL_DRAW_INDIRECT_BUFFER`
- 调用 `glDrawArraysIndirect(m_primitiveType, (void*)offset)`
- 解绑 `GL_DRAW_INDIRECT_BUFFER`
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
## 需要注意
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::DrawIndirect(...)。
(void)object;
}
```
- `drawCount``stride` 当前被忽略。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [DrawIndexedIndirect](DrawIndexedIndirect.md)

View File

@@ -1,35 +1,22 @@
# OpenGLCommandList::DrawInstanced
公开方法,详见头文件声明。
# OpenGLCommandList::DrawInstanced()
```cpp
void DrawInstanced(PrimitiveType type, unsigned int vertexCount, unsigned int instanceCount, unsigned int startVertex, unsigned int startInstance);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `type` - 参数语义详见头文件声明。
- `vertexCount` - 参数语义详见头文件声明。
- `instanceCount` - 参数语义详见头文件声明。
- `startVertex` - 参数语义详见头文件声明。
- `startInstance` - 参数语义详见头文件声明。
执行一次带实例化的非索引绘制。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
- 更新 `m_primitiveType = ToOpenGL(type)`
- 调用 `glDrawArraysInstanced(m_primitiveType, startVertex, vertexCount, instanceCount)`
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
## 需要注意
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::DrawInstanced(...)。
(void)object;
}
```
- `startInstance` 当前被忽略。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Draw](Draw.md)

View File

@@ -1,31 +1,20 @@
# OpenGLCommandList::Enable
公开方法,详见头文件声明。
# OpenGLCommandList::Enable()
```cpp
void Enable(unsigned int cap);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `cap` - 参数语义详见头文件声明。
开启一个全局 OpenGL capability。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::Enable(...)。
(void)object;
}
glEnable(cap);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Disable](Disable.md)
- [Enablei](Enablei.md)

View File

@@ -1,31 +1,19 @@
# OpenGLCommandList::EnableBlending
公开方法,详见头文件声明。
# OpenGLCommandList::EnableBlending()
```cpp
void EnableBlending(bool enable);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `enable` - 参数语义详见头文件声明。
开启或关闭全局混合状态。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EnableBlending(...)。
(void)object;
}
```
- `true` 时调用 `glEnable(GL_BLEND)`
- `false` 时调用 `glDisable(GL_BLEND)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [SetBlendFunc](SetBlendFunc.md)
- [SetBlendEquation](SetBlendEquation.md)

View File

@@ -1,31 +1,19 @@
# OpenGLCommandList::EnableCulling
公开方法,详见头文件声明。
# OpenGLCommandList::EnableCulling()
```cpp
void EnableCulling(bool enable);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `enable` - 参数语义详见头文件声明。
开启或关闭背面裁剪能力位。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EnableCulling(...)。
(void)object;
}
```
- `true` 时调用 `glEnable(GL_CULL_FACE)`
- `false` 时调用 `glDisable(GL_CULL_FACE)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [SetCullFace](SetCullFace.md)
- [SetFrontFace](SetFrontFace.md)

View File

@@ -1,31 +1,19 @@
# OpenGLCommandList::EnableDepthTest
公开方法,详见头文件声明。
# OpenGLCommandList::EnableDepthTest()
```cpp
void EnableDepthTest(bool enable);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `enable` - 参数语义详见头文件声明。
开启或关闭深度测试。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EnableDepthTest(...)。
(void)object;
}
```
- `true` 时调用 `glEnable(GL_DEPTH_TEST)`
- `false` 时调用 `glDisable(GL_DEPTH_TEST)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [EnableDepthWrite](EnableDepthWrite.md)
- [SetDepthFunc](SetDepthFunc.md)

View File

@@ -1,31 +1,23 @@
# OpenGLCommandList::EnableDepthWrite
公开方法,详见头文件声明。
# OpenGLCommandList::EnableDepthWrite()
```cpp
void EnableDepthWrite(bool enable);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `enable` - 参数语义详见头文件声明。
控制深度写掩码。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EnableDepthWrite(...)。
(void)object;
}
glDepthMask(enable ? GL_TRUE : GL_FALSE);
```
## 需要注意
它不会自动开启或关闭深度测试,只影响深度写入。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [EnableDepthTest](EnableDepthTest.md)

View File

@@ -1,31 +1,19 @@
# OpenGLCommandList::EnableScissorTest
公开方法,详见头文件声明。
# OpenGLCommandList::EnableScissorTest()
```cpp
void EnableScissorTest(bool enable);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `enable` - 参数语义详见头文件声明。
开启或关闭 scissor test。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EnableScissorTest(...)。
(void)object;
}
```
- `true` 时调用 `glEnable(GL_SCISSOR_TEST)`
- `false` 时调用 `glDisable(GL_SCISSOR_TEST)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [SetScissor](SetScissor.md)
- [SetScissorRects](SetScissorRects.md)

View File

@@ -1,31 +1,19 @@
# OpenGLCommandList::EnableStencilTest
公开方法,详见头文件声明。
# OpenGLCommandList::EnableStencilTest()
```cpp
void EnableStencilTest(bool enable);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `enable` - 参数语义详见头文件声明。
开启或关闭模板测试。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EnableStencilTest(...)。
(void)object;
}
```
- `true` 时调用 `glEnable(GL_STENCIL_TEST)`
- `false` 时调用 `glDisable(GL_STENCIL_TEST)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [SetStencilFunc](SetStencilFunc.md)
- [SetStencilOp](SetStencilOp.md)

View File

@@ -1,32 +1,20 @@
# OpenGLCommandList::Enablei
公开方法,详见头文件声明。
# OpenGLCommandList::Enablei()
```cpp
void Enablei(unsigned int cap, unsigned int index);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `cap` - 参数语义详见头文件声明。
- `index` - 参数语义详见头文件声明。
开启某个带索引的 capability。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::Enablei(...)。
(void)object;
}
glEnablei(cap, index);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Disablei](Disablei.md)
- [Enable](Enable.md)

View File

@@ -1,31 +1,19 @@
# OpenGLCommandList::EndQuery
公开方法,详见头文件声明。
# OpenGLCommandList::EndQuery()
```cpp
void EndQuery(unsigned int target);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `target` - 参数语义详见头文件声明。
结束指定 target 上的 query。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EndQuery(...)。
(void)object;
}
glEndQuery(target);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BeginQuery](BeginQuery.md)

View File

@@ -1,30 +1,27 @@
# OpenGLCommandList::EndRenderPass
公开方法,详见头文件声明。
# OpenGLCommandList::EndRenderPass()
```cpp
void EndRenderPass() override;
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
结束当前 render pass
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
当前实现只做:
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::EndRenderPass(...)。
(void)object;
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
```
## 需要注意
- 不会显式释放 `m_composedFramebuffer`
- 不会恢复更细粒度的 render pass 状态。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BeginRenderPass](BeginRenderPass.md)
- [SetRenderTargets](SetRenderTargets.md)

View File

@@ -1,33 +1,19 @@
# OpenGLCommandList::InvalidateFramebuffer
公开方法,详见头文件声明。
# OpenGLCommandList::InvalidateFramebuffer()
```cpp
void InvalidateFramebuffer(unsigned int target, unsigned int count, const unsigned int* attachments);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `target` - 参数语义详见头文件声明。
- `count` - 参数语义详见头文件声明。
- `attachments` - 参数语义详见头文件声明。
向驱动提示一组 framebuffer attachment 内容可被丢弃。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::InvalidateFramebuffer(...)。
(void)object;
}
glInvalidateFramebuffer(target, count, attachments);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [InvalidateSubFramebuffer](InvalidateSubFramebuffer.md)

View File

@@ -1,37 +1,19 @@
# OpenGLCommandList::InvalidateSubFramebuffer
公开方法,详见头文件声明。
# OpenGLCommandList::InvalidateSubFramebuffer()
```cpp
void InvalidateSubFramebuffer(unsigned int target, unsigned int count, const unsigned int* attachments, int x, int y, int width, int height);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `target` - 参数语义详见头文件声明。
- `count` - 参数语义详见头文件声明。
- `attachments` - 参数语义详见头文件声明。
- `x` - 参数语义详见头文件声明。
- `y` - 参数语义详见头文件声明。
- `width` - 参数语义详见头文件声明。
- `height` - 参数语义详见头文件声明。
对 framebuffer 的一个子区域执行 invalidate 提示。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::InvalidateSubFramebuffer(...)。
(void)object;
}
glInvalidateSubFramebuffer(target, count, attachments, x, y, width, height);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [InvalidateFramebuffer](InvalidateFramebuffer.md)

View File

@@ -1,31 +1,25 @@
# OpenGLCommandList::MemoryBarrier
公开方法,详见头文件声明。
# OpenGLCommandList::MemoryBarrier()
```cpp
void MemoryBarrier(unsigned int barriers);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `barriers` - 参数语义详见头文件声明。
显式发出 OpenGL memory barrier。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::MemoryBarrier(...)。
(void)object;
}
glMemoryBarrier(barriers);
```
## 与 `TransitionBarrier()` 的区别
- `MemoryBarrier()` 只是原生 barrier 直通。
- [TransitionBarrier](TransitionBarrier.md) 还会更新资源视图对应纹理的软状态元数据。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [TextureBarrier](TextureBarrier.md)
- [TransitionBarrier](TransitionBarrier.md)

View File

@@ -1,34 +1,18 @@
# OpenGLCommandList::MultiDrawArrays
公开方法,详见头文件声明。
# OpenGLCommandList::MultiDrawArrays()
```cpp
void MultiDrawArrays(PrimitiveType type, const int* first, const int* count, unsigned int drawCount);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `type` - 参数语义详见头文件声明。
- `first` - 参数语义详见头文件声明。
- `count` - 参数语义详见头文件声明。
- `drawCount` - 参数语义详见头文件声明。
执行多次非索引绘制。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::MultiDrawArrays(...)。
(void)object;
}
```
- 先更新 `m_primitiveType = ToOpenGL(type)`
- 再调用 `glMultiDrawArrays(m_primitiveType, first, count, drawCount)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [MultiDrawElements](MultiDrawElements.md)

View File

@@ -1,35 +1,22 @@
# OpenGLCommandList::MultiDrawElements
公开方法,详见头文件声明。
# OpenGLCommandList::MultiDrawElements()
```cpp
void MultiDrawElements(PrimitiveType type, const int* count, unsigned int type_, const void* const* indices, unsigned int drawCount);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `type` - 参数语义详见头文件声明。
- `count` - 参数语义详见头文件声明。
- `type_` - 参数语义详见头文件声明。
- `indices` - 参数语义详见头文件声明。
- `drawCount` - 参数语义详见头文件声明。
执行多次索引绘制。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
- 先更新 `m_primitiveType = ToOpenGL(type)`
- 再调用 `glMultiDrawElements(m_primitiveType, count, type_, indices, drawCount)`
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
## 需要注意
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::MultiDrawElements(...)。
(void)object;
}
```
索引类型来自参数 `type_`,而不是命令列表缓存的 `m_currentIndexType`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [MultiDrawArrays](MultiDrawArrays.md)

View File

@@ -1,30 +1,19 @@
# OpenGLCommandList::PopDebugGroup
公开方法,详见头文件声明。
# OpenGLCommandList::PopDebugGroup()
```cpp
void PopDebugGroup();
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
结束当前 OpenGL debug group
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::PopDebugGroup(...)。
(void)object;
}
glPopDebugGroup();
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [PushDebugGroup](PushDebugGroup.md)

View File

@@ -1,34 +1,19 @@
# OpenGLCommandList::PushDebugGroup
公开方法,详见头文件声明。
# OpenGLCommandList::PushDebugGroup()
```cpp
void PushDebugGroup(unsigned int source, unsigned int id, int length, const char* message);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `source` - 参数语义详见头文件声明。
- `id` - 参数语义详见头文件声明。
- `length` - 参数语义详见头文件声明。
- `message` - 参数语义详见头文件声明。
开始一个 OpenGL debug group。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::PushDebugGroup(...)。
(void)object;
}
glPushDebugGroup(source, id, length, message);
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [PopDebugGroup](PopDebugGroup.md)

View File

@@ -1,37 +1,23 @@
# OpenGLCommandList::ReadPixels
公开方法,详见头文件声明。
# OpenGLCommandList::ReadPixels()
```cpp
void ReadPixels(int x, int y, int width, int height, unsigned int format, unsigned int type, void* data);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `x` - 参数语义详见头文件声明。
- `y` - 参数语义详见头文件声明。
- `width` - 参数语义详见头文件声明。
- `height` - 参数语义详见头文件声明。
- `format` - 参数语义详见头文件声明。
- `type` - 参数语义详见头文件声明。
- `data` - 参数语义详见头文件声明。
从当前 read framebuffer 读取像素。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::ReadPixels(...)。
(void)object;
}
glReadPixels(x, y, width, height, format, type, data);
```
## 需要注意
函数不会调整 pack 状态,也不会切换 read framebuffer。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [BlitFramebuffer](BlitFramebuffer.md)

View File

@@ -1,30 +1,34 @@
# OpenGLCommandList::Reset
公开方法,详见头文件声明。
# OpenGLCommandList::Reset()
```cpp
void Reset() override;
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
重置命令列表中的一部分缓存状态
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
`Reset()` 会:
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
- 调用 `ReleaseComposedFramebuffer()`
-`m_currentPipelineState` 设为 `nullptr`
-`m_currentIndexOffset` 重置为 `0`
-`m_currentIndexType` 重置为 `GL_UNSIGNED_INT`
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::Reset(...)。
(void)object;
}
```
## 需要注意
它不会:
- 删除 `m_internalVAO`
- 清空 `m_currentProgram`
- 重置 `m_primitiveType`
- 关闭已经启用的 capability
所以它不是“完全回到构造态”,而是一次部分缓存清理。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [Close](Close.md)
- [Shutdown](Shutdown.md)

View File

@@ -1,30 +1,19 @@
# OpenGLCommandList::TextureBarrier
公开方法,详见头文件声明。
# OpenGLCommandList::TextureBarrier()
```cpp
void TextureBarrier();
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
发出 OpenGL 纹理相关 barrier
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::TextureBarrier(...)。
(void)object;
}
glTextureBarrier();
```
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [MemoryBarrier](MemoryBarrier.md)

View File

@@ -1,31 +1,23 @@
# OpenGLCommandList::UseProgram
公开方法,详见头文件声明。
# OpenGLCommandList::UseProgram()
```cpp
void UseProgram(unsigned int program);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `program` - 参数语义详见头文件声明。
直接调用 OpenGL 绑定 program。
**返回:** `void` - 无返回值。
**示例:**
## 当前实现行为
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::UseProgram(...)。
(void)object;
}
glUseProgram(program);
```
## 与 `UseShader()` 的区别
这个函数不会更新命令列表内部缓存的 `m_currentProgram`。如果上层逻辑依赖这份缓存,应该优先使用 [UseShader](UseShader.md)。
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [UseShader](UseShader.md)

View File

@@ -1,31 +1,19 @@
# OpenGLCommandList::UseShader
公开方法,详见头文件声明。
# OpenGLCommandList::UseShader()
```cpp
void UseShader(unsigned int program);
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLCommandList.h`,当前页面用于固定 `OpenGLCommandList` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
- `program` - 参数语义详见头文件声明。
绑定 program并同步更新命令列表内部缓存。
**返回:** `void` - 无返回值。
## 当前实现行为
**示例:**
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLCommandList.h>
void Example() {
XCEngine::RHI::OpenGLCommandList object;
// 根据上下文补齐参数后调用 OpenGLCommandList::UseShader(...)。
(void)object;
}
```
- `m_currentProgram = program`
- `glUseProgram(program)`
## 相关文档
- [返回类总览](OpenGLCommandList.md)
- [返回模块目录](../OpenGL.md)
- [UseProgram](UseProgram.md)
- [SetShader](SetShader.md)

View File

@@ -1,30 +1,36 @@
# OpenGLDevice::MakeContextCurrent
公开方法,详见头文件声明。
# OpenGLDevice::MakeContextCurrent()
```cpp
bool MakeContextCurrent();
```
该方法声明于 `XCEngine/RHI/OpenGL/OpenGLDevice.h`,当前页面用于固定 `OpenGLDevice` 类目录下的方法级 canonical 路径。
## 作用
**参数:**
把当前设备持有的 WGL 上下文切换为当前线程上下文
**返回:** `bool` - 返回值语义详见头文件声明。
## 返回值
**示例:**
- `true`: `m_hdc``m_hglrc` 都存在,且 `wglMakeCurrent(m_hdc, m_hglrc)` 返回成功。
- `false`: 任一句柄为空,或 `wglMakeCurrent` 失败。
## 当前实现行为
函数逻辑非常直接:
```cpp
#include <XCEngine/RHI/OpenGL/OpenGLDevice.h>
void Example() {
XCEngine::RHI::OpenGLDevice object;
// 根据上下文补齐参数后调用 OpenGLDevice::MakeContextCurrent(...)。
(void)object;
if (m_hdc && m_hglrc) {
return ::wglMakeCurrent(m_hdc, m_hglrc) == TRUE;
}
return false;
```
## 需要注意
- 当前不会先检查“这个上下文是否已经是当前上下文”。
- 它是很多资源创建路径的前置条件,例如 `CreateTexture()``CreateShader()``CreatePipelineState()`
## 相关文档
- [返回类总览](OpenGLDevice.md)
- [返回模块目录](../OpenGL.md)
- [OpenGLDevice](OpenGLDevice.md)
- [Initialize](Initialize.md)
- [InitializeWithExistingWindow](InitializeWithExistingWindow.md)

View File

@@ -1,6 +1,6 @@
# API 文档重构状态
**生成时间**: `2026-03-28 02:20:55`
**生成时间**: `2026-03-28 02:28:02`
**来源**: `docs/api/_tools/audit_api_docs.py`