error by createGraphicsPipelineState
My Input layout looks like this:
input_layout = Falcor::VertexLayout::create();
Falcor::VertexBufferLayout::SharedPtr pVbLayout = Falcor::VertexBufferLayout::create();
pVbLayout->addElement("POSITION", 0, ResourceFormat::RGB32Float, 1, 0);
pVbLayout->addElement("TEXCOORD", 12, ResourceFormat::RGBA32Float, 1, 1);
pVbLayout->addElement("TEXCOORD", 28, ResourceFormat::RGBA16Float, 1, 2);
input_layout->addBufferLayout(0, pVbLayout);
when I call createGraphicsPipelineState, I got an error: D3D12 ERROR: ID3D12Device::CreateInputLayout: Element[2] and Element[1] have the same Semantic (TEXCOORD 0). All Semantics in the Input Layout must be unique. This error is only printed on the first occurence detected. [ STATE_CREATION ERROR #62: CREATEINPUTLAYOUT_DUPLICATESEMANTIC]
This is not a bug, DirectX requires input layout elements to have unique semantic names per layout.
If you have a texcoord array in your shader, the names should be TEXCOORD[0] and TEXCOORD[1]
Does Falcor support using numbered semantics, e.g., COLOR0 and COLOR1?
In the bare D3D12 API, you would handle that case by specifying a separate "semantic name" and "semantic index" and the API only requires that the name+index be unique. If Falcor parses an integer suffix on the semantic name string, then that would work, but it might also surprise users coming from the bare D3D API.
We do.
@bryan05 Ignore my previous comment.
pVbLayout->addElement() accepts an arraySize. You don't need to call it twice for TEXCOORD, just call it once and pass 2 as the array size.
TEXCOORD 0 is ResourceFormat::RGBA32Float but TEXCOORD 1 is ResourceFormat::RGBA16Float, does the array still work?
No, Falcor doesn't support that :( Reopening the issue, we'll need to support it at some point, but it's low priority for now