Jump to content

  • Log In with Google      Sign In   
  • Create Account


CreateInputLayout throws E_INVALIDARG


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 trevex   Members   -  Reputation: 125

Like
0Likes
Like

Posted 21 December 2012 - 10:03 AM

I am currently working with DirectX on a Coursework Assignment. My first simple shader worked fine, but now after adding some complexity and changing the input layout the code throws an unexpected error. I found a few related posts around here, that unfortunately didn't help me. 

The input layout in the shader is defined as followed:

struct VSInput
{
	float3 Position : POSITION;
	float2 TexCoord : TEXCOORD0;
	float3 Normal   : NORMAL;
};

 

I try to setup the input layout in my small material class like this ( I use the effects framework):

const D3D11_INPUT_ELEMENT_DESC basicInput[] = 
{
	{"POSITION",  0, DXGI_FORMAT_R32G32B32_FLOAT, 0,  0, D3D11_INPUT_PER_VERTEX_DATA, 0},
	{"TEXCOORD0", 0, DXGI_FORMAT_R32G32_FLOAT,    0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0},
	{"NORMAL",    0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 20, D3D11_INPUT_PER_VERTEX_DATA, 0}
};


D3DX11_PASS_DESC passDesc;
m_Tech->GetPassByIndex(0)->GetDesc(&passDesc);
HR(static_cast<SDXRenderInfo*>(g_RenderInfo)->device->CreateInputLayout(basicInput, 3, 
passDesc.pIAInputSignature, passDesc.IAInputSignatureSize, &m_InputLayout));

(HR is a small macro I found in the Frank Luna book; the static_cast might be irritating but the engine supports directx and opengl and this is part of my dirty solution)

 

EDIT:

Let me know if your need more informations...

 



Sponsor:

#2 unbird   Crossbones+   -  Reputation: 4863

Like
2Likes
Like

Posted 21 December 2012 - 07:28 PM

This:
...{"TEXCOORD0",...
is illegal.

Enable the debug runtime at device creation with D3D11_CREATE_DEVICE_DEBUG and watch the debug output telling you this:

[4848] D3D10: ERROR: ID3D10Device::CreateInputLayout: Element[1]: SemanticName string ("TEXCOORD0") cannot end with a number. Instead, use the number in the SemanticIndex field. For example, ...

#3 trevex   Members   -  Reputation: 125

Like
0Likes
Like

Posted 22 December 2012 - 06:45 AM

Sorry for the delayed answers, but for whatever reason I wasn't able to login anymore...

 

Anyway thanks a lot that fixed it :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS