2
\$\begingroup\$

I get [ STATE_CREATION ERROR #161: CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE] with the following code:

// Vertex data
struct VertexData {
    XMFLOAT3 v;
    XMFLOAT2 vt;
    XMFLOAT3 vn;
};

// ...

// Create the input layout vertex shader.
D3D11_INPUT_ELEMENT_DESC vertexLayoutDesc[] =
{
    { "V", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(VertexData, v), D3D11_INPUT_PER_VERTEX_DATA, 0 },
    { "VT", 0, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(VertexData, vt), D3D11_INPUT_PER_VERTEX_DATA, 0 },
    { "VN", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(VertexData, vn), D3D11_INPUT_PER_VERTEX_DATA, 0 }
};

HRESULT hr = g_d3dDevice->CreateInputLayout(vertexLayoutDesc, _countof(vertexLayoutDesc), geomVertexShaderBlob->GetBufferPointer(), geomPixelShaderBlob->GetBufferSize(), &g_d3dInputLayout);

And wannabe matching HLSL code:

struct Input
{
    float3 v : V;
    float2 vt : VT;
    float3 vn : VN;
};

struct Output
{
    float4 color : COLOR;
    float4 position : SV_POSITION;
};

Output main(Input input) {...}

I can't spot the mismatch and what exactly the error message is pointing to. Weird thing I have very similar input layout and shaders that work perfectly fine, but this one doesn't.

\$\endgroup\$
2
  • \$\begingroup\$ please show the arguments to CreateInputLayout \$\endgroup\$
    – Bahbar
    Commented Oct 15, 2015 at 15:21
  • \$\begingroup\$ I am calling CreateInputLayout() with the just created vertex shader blob & a nullptr input layout. \$\endgroup\$
    – PinkTurtle
    Commented Oct 15, 2015 at 15:24

1 Answer 1

2
\$\begingroup\$

Looks like this is the issue (buffer pointer mismatch - geomVertexShaderBlob vs geomPixelShaderBlob):

geomVertexShaderBlob->GetBufferPointer(), geomPixelShaderBlob->GetBufferSize()

\$\endgroup\$
3
  • \$\begingroup\$ This is exactly what I have written, I don't get it. EDIT Damn!!! I'm really that stupid =) \$\endgroup\$
    – PinkTurtle
    Commented Oct 15, 2015 at 16:22
  • \$\begingroup\$ @PinkTurtle Updated the answer, do you see it now? :) \$\endgroup\$
    – snake5
    Commented Oct 15, 2015 at 16:24
  • \$\begingroup\$ Yus I do :) .... \$\endgroup\$
    – PinkTurtle
    Commented Oct 15, 2015 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .