Files
XCEngine/docs/api/rhi/enums/comparison-func.md

44 lines
917 B
Markdown
Raw Normal View History

2026-03-20 02:35:45 +08:00
# ComparisonFunc
**命名空间**: `XCEngine::RHI`
**类型**: `enum class`
**描述**: 比较函数枚举,定义深度和模板测试的比较方式
## 概述
ComparisonFunc 枚举用于深度测试和模板测试中的比较操作,决定何时通过测试。
## 枚举值
| 枚举值 | 描述 |
|--------|------|
| `Never` | 永不通过 |
| `Less` | 小于比较 |
| `Equal` | 等于比较 |
| `LessEqual` | 小于等于比较 |
| `Greater` | 大于比较 |
| `NotEqual` | 不等于比较 |
| `GreaterEqual` | 大于等于比较 |
| `Always` | 永远通过 |
## 使用示例
```cpp
#include "RHI/RHIEnums.h"
void Example() {
ComparisonFunc depthFunc = ComparisonFunc::Less;
if (depthFunc == ComparisonFunc::Equal) {
// 等于深度时通过
}
}
```
## 相关文档
- [StencilOp](stencil-op.md) - 模板操作枚举
- [FilterMode](filter-mode.md) - 采样过滤模式枚举