34 lines
916 B
Markdown
34 lines
916 B
Markdown
# 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` - 起始索引偏移(默认 0)
|
||
- `baseVertex` - 基础顶点偏移(默认 0)
|
||
- `startInstance` - 起始实例偏移(默认 0)
|
||
|
||
**返回:** `void`
|
||
|
||
**异常:** 无
|
||
|
||
**线程安全:** ❌
|
||
|
||
**复杂度:** O(indexCount * instanceCount)
|
||
|
||
**示例:**
|
||
|
||
```cpp
|
||
cmdList->DrawIndexed(36); // 绘制36个索引
|
||
```
|
||
|
||
## 相关文档
|
||
|
||
- [RHICommandList 总览](command-list.md) - 返回类总览
|
||
- [Draw](draw.md) - 绘制
|
||
- [SetIndexBuffer](set-index-buffer.md) - 设置索引缓冲 |