40 lines
1.9 KiB
Markdown
40 lines
1.9 KiB
Markdown
# BuiltinPassResourceBindingPlan
|
||
|
||
**命名空间**: `XCEngine::Rendering`
|
||
|
||
**类型**: `struct`
|
||
|
||
**头文件**: `XCEngine/Rendering/RenderMaterialUtility.h`
|
||
|
||
## 字段
|
||
|
||
| 字段 | 类型 | 说明 |
|
||
|------|------|------|
|
||
| `bindings` | `Containers::Array<BuiltinPassResourceBindingDesc>` | 归一化后的绑定列表。 |
|
||
| `maxSetIndex` | `Core::uint32` | 当前绑定里出现过的最大 set index。 |
|
||
| `firstDescriptorSet` | `Core::uint32` | 当前绑定里最小的 set index。 |
|
||
| `descriptorSetCount` | `Core::uint32` | 从最小 set 到最大 set 的连续区间长度。 |
|
||
| `usesConstantBuffers` | `bool` | 是否出现过 constant buffer。 |
|
||
| `usesTextures` | `bool` | 是否出现过纹理。 |
|
||
| `usesSamplers` | `bool` | 是否出现过 sampler。 |
|
||
| `perObject` | [PassResourceBindingLocation](PassResourceBindingLocation.md) | `PerObject` 的槽位。 |
|
||
| `material` | [PassResourceBindingLocation](PassResourceBindingLocation.md) | `Material` 的槽位。 |
|
||
| `baseColorTexture` | [PassResourceBindingLocation](PassResourceBindingLocation.md) | `BaseColorTexture` 的槽位。 |
|
||
| `linearClampSampler` | [PassResourceBindingLocation](PassResourceBindingLocation.md) | `LinearClampSampler` 的槽位。 |
|
||
|
||
## `FindBinding()` 语义
|
||
|
||
- 顺序扫描 `bindings`,返回首个匹配目标语义的条目。
|
||
- 当前每种 builtin 语义至多允许出现一次;若重复,binding-plan 构建会失败。
|
||
|
||
## 当前使用位置
|
||
|
||
- [BuiltinForwardPipeline](../Pipelines/BuiltinForwardPipeline/BuiltinForwardPipeline.md) 会先拿到这份 plan,再继续创建 pass layout 和 descriptor set。
|
||
- [BuiltinObjectIdPass](../Passes/BuiltinObjectIdPass/BuiltinObjectIdPass.md) 也用同一份 plan 解析 object-id 的 `PerObject` 绑定。
|
||
|
||
## 相关文档
|
||
|
||
- [BuiltinPassResourceBindingDesc](BuiltinPassResourceBindingDesc.md)
|
||
- [TryBuildBuiltinPassResourceBindingPlan](TryBuildBuiltinPassResourceBindingPlan.md)
|
||
- [RenderMaterialUtility](RenderMaterialUtility.md)
|