64 lines
1.3 KiB
Markdown
64 lines
1.3 KiB
Markdown
|
|
# OpenGLCommandQueue
|
|||
|
|
|
|||
|
|
OpenGL 命令队列实现。OpenGL 是立即模式 API,此类主要提供 RHI 接口兼容。
|
|||
|
|
|
|||
|
|
## 头文件
|
|||
|
|
|
|||
|
|
```cpp
|
|||
|
|
#include <XCEngine/RHI/OpenGL/OpenGLCommandQueue.h>
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 继承关系
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
RHICommandQueue (interface)
|
|||
|
|
└── OpenGLCommandQueue (implementation)
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 公共成员函数
|
|||
|
|
|
|||
|
|
### 构造函数与析构函数
|
|||
|
|
|
|||
|
|
#### `OpenGLCommandQueue()`
|
|||
|
|
|
|||
|
|
#### `~OpenGLCommandQueue() override`
|
|||
|
|
|
|||
|
|
### 生命周期
|
|||
|
|
|
|||
|
|
#### `void Shutdown() override`
|
|||
|
|
|
|||
|
|
### 命令执行
|
|||
|
|
|
|||
|
|
#### `void ExecuteCommandLists(uint32_t count, void** lists) override`
|
|||
|
|
执行命令列表(OpenGL 下为 no-op,直接调用 GL 命令)。
|
|||
|
|
|
|||
|
|
### 同步
|
|||
|
|
|
|||
|
|
#### `void Signal(RHIFence* fence, uint64_t value) override`
|
|||
|
|
发送信号。
|
|||
|
|
|
|||
|
|
#### `void Wait(RHIFence* fence, uint64_t value) override`
|
|||
|
|
等待栅栏。
|
|||
|
|
|
|||
|
|
#### `uint64_t GetCompletedValue() override`
|
|||
|
|
|
|||
|
|
#### `void WaitForIdle() override`
|
|||
|
|
等待空闲(调用 `glFinish`)。
|
|||
|
|
|
|||
|
|
### 属性
|
|||
|
|
|
|||
|
|
#### `CommandQueueType GetType() const override`
|
|||
|
|
返回 `CommandQueueType::Direct`。
|
|||
|
|
|
|||
|
|
#### `uint64_t GetTimestampFrequency() const override`
|
|||
|
|
返回 0。
|
|||
|
|
|
|||
|
|
#### `void* GetNativeHandle() override`
|
|||
|
|
返回 `nullptr`。
|
|||
|
|
|
|||
|
|
## 备注
|
|||
|
|
|
|||
|
|
- OpenGL 没有显式的命令队列,所有命令立即执行
|
|||
|
|
- `ExecuteCommandLists` 在 OpenGL 后端为空操作
|
|||
|
|
- `Signal`/`Wait` 仍然工作,使用 GLsync/fence 对象实现
|