1.5 KiB
1.5 KiB
BuiltinObjectIdPass::BuildInputLayout
返回 builtin object-id pass 当前使用的静态顶点布局。
static RHI::InputLayoutDesc BuildInputLayout();
当前实现返回值
当前实现会按 Resources::StaticMeshVertex 的字段顺序构造 3 个输入元素:
POSITIONsemanticIndex = 0format = R32G32B32_FloatinputSlot = 0alignedByteOffset = offsetof(Resources::StaticMeshVertex, position)
NORMALsemanticIndex = 0format = R32G32B32_FloatinputSlot = 0alignedByteOffset = offsetof(Resources::StaticMeshVertex, normal)
TEXCOORDsemanticIndex = 0format = R32G32_FloatinputSlot = 0alignedByteOffset = offsetof(Resources::StaticMeshVertex, uv0)
当前语义
- 这不是“只包含位置”的极简布局;当前 object-id pass 仍然沿用静态网格常用的
POSITION / NORMAL / TEXCOORD0输入契约。 - 这样构建出来的 pipeline 能直接消费
RenderResourceCache上传的StaticMeshVertex顶点流,而不需要为 object-id 路径单独准备另一套顶点缓冲描述。 - 资源绑定层面上,object-id pass 只要求
PerObject常量缓冲;这和顶点布局是两个独立维度。
测试覆盖
tests/Rendering/unit/test_builtin_forward_pipeline.cpp显式验证了这里返回的 3 个输入元素及其 offset。