Error #342: device_shader_linkage_semanticname_not_found

Started by
14 comments, last by riuthamus 11 years, 7 months ago
I've stared at this for at least half an hour now and I cannot figure out what directx is complaining about. I know this error normally means you put float3 instead of a float4 or something like that, but I've checked over and over and as far as I can tell, everything matches.

This is the full error message:


D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Input Assembler - Vertex Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (COLOR,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND ]


This is the vertex shader's input signature as seen in PIX:


// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// POSITION 0 xyz 0 NONE float xyz
// NORMAL 0 xyz 1 NONE float
// COLOR 0 xyzw 2 NONE float


The HLSL structure looks like this:


struct VertexShaderInput
{
float3 Position : POSITION0;
float3 Normal : NORMAL0;
float4 Color: COLOR0;
};


The input layout, from PIX, is:

[attachment=11040:InputLayouts.png]

The C# structure holding the data looks like this:


[StructLayout(LayoutKind.Sequential)]
public struct PositionColored
{
public static int SizeInBytes = Marshal.SizeOf(typeof(PositionColored));

public static InputElement[] InputElements = new[]
{
new InputElement("POSITION", 0, Format.R32G32B32_Float, 0),
new InputElement("NORMAL", 0, Format.R32G32B32_Float, 0),
new InputElement("COLOR", 0, Format.R32G32B32A32_Float, 0)
};

Vector3 position;
Vector3 normal;
Vector4 color;

#region Properties
...
#endregion

public PositionColored(Vector3 position, Vector3 normal, Vector4 color)
{
this.position = position;
this.normal = normal;
this.color = color;
}
public override string ToString()
{
StringBuilder sb = new StringBuilder(base.ToString());
sb.Append(" Position=");
sb.Append(position);
sb.Append(" Color=");
sb.Append(Color);
return sb.ToString();
}
}


SizeInBytes comes out to 40, which is correct (4*3 + 4*3 + 4*4 = 40). Can anyone find where the mistake is?
Advertisement
Everything you've posted looks okay. Are you sure you have the right input layout and vertex shader bound when that error message gets output? If you capture a frame in PIX, you can double-click on the error and it will take you to the exact call that caused it. Then you can check the state of your device context, and make sure it's what you expect it to be.
Yea, the screenshot of the input layout is from the device state on the draw call that has the warning. I also double checked in the code that it sets the right layout before drawing.
Perhaps there is another way to put down point lights? or is this the only method when using deferred rendering? Cause we are at a dead end if there is no error with our code. *shrugs* thanks for the help MJP though.
I never looked that deep into deferred rendering so I can't help you on that atm but is it possible to see some shader code because when directx is complaining the error is not always where it says it should be.
Yeah, def. I will have him post it as soon as he gets up. Or pm you with it, you have been most helpful quiSHAD, if you ever need some art let me know.
I'm not familiar with that error, but is it possible that its complaining when trying to link the pixel/vertex shaders together? Does the PS require a COLOR0 input that the VS isn't outputting?

Yeah, def. I will have him post it as soon as he gets up. Or pm you with it, you have been most helpful quiSHAD, if you ever need some art let me know.


Thanks I'm always glad when I can help. Also I like challenging problems and not only within my projects.



I'm not familiar with that error, but is it possible that its complaining when trying to link the pixel/vertex shaders together? Does the PS require a COLOR0 input that the VS isn't outputting?


I would say everything is possible but typically D3D11 would output something like: "D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader"
So it is pointing in to VS input. But in my experience sometimes even D3D is confused. So theoretically the error could be everywhere and most likely at a point where you normally would never look for it.

I would say everything is possible but typically D3D11 would output something like: "D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader"
So it is pointing in to VS input. But in my experience sometimes even D3D is confused. So theoretically the error could be everywhere and most likely at a point where you normally would never look for it.


This was the problem that we were afraid of. We almost were hoping it was a numerical issue rather than having to deal with a "needle in a haystack" situation. Telanor should be up 3 hours, I will make sure he sees this once he does and we can go from there. Thanks again, both of you.

This is the vertex shader's input signature as seen in PIX:

// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// POSITION 0 xyz 0 NONE float xyz
// NORMAL 0 xyz 1 NONE float
// COLOR 0 xyzw 2 NONE float



Just trying to help think outloud, but is it a problem that your normal and color values show as unused in this PIX data?

edit: oh god that converted horribly. Quote tool doth not preserve tab spacing

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

This topic is closed to new replies.

Advertisement