docs: update RHI API docs

This commit is contained in:
2026-03-20 02:35:45 +08:00
parent ea756c0177
commit 070b444f8f
501 changed files with 13493 additions and 2022 deletions

View File

@@ -4,21 +4,40 @@
void SetBlendState(const BlendState& state)
```
设置混合状态。
设置颜色混合状态。
**参数:**
- `state` - 混合状态结构
- `state` - 混合状态结构,包含以下成员:
- `alphaToCoverageEnable` - Alpha to coverage 使能标志
- `renderTargets[0]` - 渲染目标混合配置(以第一个为例):
- `blendEnable` - 混合使能标志
- `srcBlend` - RGB 源混合因子(参见 `BlendFactor` 枚举)
- `dstBlend` - RGB 目标混合因子
- `srcBlendAlpha` - Alpha 源混合因子
- `dstBlendAlpha` - Alpha 目标混合因子
- `blendOp` - RGB 混合操作(参见 `BlendOp` 枚举)
- `blendOpAlpha` - Alpha 混合操作
**返回值**:无
**示例:**
```cpp
BlendState state;
state.enable = true;
state.srcBlend = BlendFunc::SrcAlpha;
state.dstBlend = BlendFunc::InvSrcAlpha;
state.alphaToCoverageEnable = false;
state.renderTargets[0].blendEnable = true;
state.renderTargets[0].srcBlend = BlendFactor::SrcAlpha;
state.renderTargets[0].dstBlend = BlendFactor::InvSrcAlpha;
state.renderTargets[0].srcBlendAlpha = BlendFactor::One;
state.renderTargets[0].dstBlendAlpha = BlendFactor::InvSrcAlpha;
state.renderTargets[0].blendOp = BlendOp::Add;
state.renderTargets[0].blendOpAlpha = BlendOp::Add;
commandList->SetBlendState(state);
```
## 相关文档
- [OpenGLCommandList](command-list.md) - 返回类总览
- [OpenGLCommandList 总览](command-list.md) - 返回类总览
- [SetBlendFactor](set-blend-factor.md) - 设置混合常量颜色
- [BlendFactor](../../enums/blend-factor.md) - 混合因子枚举
- [BlendOp](../../enums/blend-op.md) - 混合操作枚举