Inputlayout problem (dx11) after visual studio 11 preview installation

Started by
15 comments, last by Jason Z 12 years, 7 months ago
Hi
I get a really weird error, and I cant figure out whats wrong tbh. I installed visual studio 11 developers preview today (I am starting to think that it might have been a mistake tbh). After I installed it I started to get this error written to my output and I honestly have no idea what to make out of it. An old projekt of mine get the same, but after a render calls it crashes. This only occur when I use the debugflag during creation of the device. My old project worked with debugflag before without crashes. This happens even if I use vs2010 now, my guess is that vs11 updated some files for vs2010 as well :/ I still get the error-output after removing everything but initialization of directx, and creation of one Vertexshader and the creation of the inputlayout. Have anyone seen this error before? To be honest I am starting to think there's a bug in some file that visual studio 11 preview updated or installed that causes this, or that I need to set more flags or settings somewhere in order to use the debugflag during device-creation.


On inputlayout creation I get the following error in output, but the createinputlayout function returns S_OK
D3D11: ERROR: ID3D11Device::CreateInputLayout: The provided input signature expects to read an element with SemanticName/Index: '(null)'/9714417, but the declaration doesn't provide a matching name. [ STATE_CREATION ERROR #163: CREATEINPUTLAYOUT_MISSINGELEMENT ]




D3D11_INPUT_ELEMENT_DESC polygonLayout[2];
unsigned int numelements = 2;
polygonLayout[0].SemanticName = "POSITION";
polygonLayout[0].SemanticIndex = 0;
polygonLayout[0].Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
polygonLayout[0].InputSlot = 0;
polygonLayout[0].AlignedByteOffset = 0;
polygonLayout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
polygonLayout[0].InstanceDataStepRate = 0;

polygonLayout[1].SemanticName = "COLOR";
polygonLayout[1].SemanticIndex = 0;
polygonLayout[1].Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
polygonLayout[1].InputSlot = 0;
polygonLayout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
polygonLayout[1].InstanceDataStepRate = 0;

HRESULT hr = m_Device->CreateInputLayout(polygonLayout,numelements,_VShader->m_ShaderBuffer->GetBufferPointer(),_VShader->m_ShaderBuffer->GetBufferSize(),&m_layout);


The HLSL I am currently testing on is very simple



cbuffer MatrixBuffer
{
matrix worldMatrix;
matrix viewMatrix;
matrix projectionMatrix;
};


//////////////
// TYPEDEFS //
//////////////
struct VertexInputType
{
float4 position : POSITION;
float4 color : COLOR;
};

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


////////////////////////////////////////////////////////////////////////////////
// Vertex Shader
////////////////////////////////////////////////////////////////////////////////
PixelInputType ColorVertexShader(VertexInputType input)
{
PixelInputType output;


// Change the position vector to be 4 units for proper matrix calculations.
input.position.w = 1.0f;

// Calculate the position of the vertex against the world, view, and projection matrices.
output.position = mul(input.position, worldMatrix);
output.position = mul(output.position, viewMatrix);
output.position = mul(output.position, projectionMatrix);

// Store the input color for the pixel shader to use.
output.color = input.color;

return output;
}




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


////////////////////////////////////////////////////////////////////////////////
// Pixel Shader
////////////////////////////////////////////////////////////////////////////////
float4 ColorPixelShader(PixelInputType input) : SV_TARGET
{
return input.color;
}


Everything renders correctly (in my current project) but everytime I call drawindexed the following is written in the output, but I think this is due to the previous "error" during the inputlayout creation.


Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Input Assembler - Vertex Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index ((null),6502817) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND ]
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index ((null),6511892) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND ]

If I use the code from this tutorial (but changes it so that the debugflag is set) the same error occurs.
http://www.rastertek.../dx11tut04.html
Advertisement
In the sample the position is a float3, the shader wants a float4

In the sample the position is a float3, the shader wants a float4


[font="Arial"]Are you talking about the sam[/font][font="Arial"]ple from the website? If so I am aware of it, and the same error occurs whether I use [size=2]DXGI_FORMAT_R32G32B32A32_FLOAT or [size=2]DXGI_FORMAT_R32G32B32_FLOAT in the inputlayout (and ofcourse changing the position-type in vertexbuffer[size=2], and shader[size=2] to match the type in the inputlayout). [/font]
Which OS did you install VS11 on? I assume it was the Win8 developer preview, but I wanted to check.

I will be installing the preview tonight, but until then I haven't been able to try building a library yet. Have you tried to compile and run one of the SDK samples? That might provide a good sanity check. Also, if you run with the reference device, what behavior do you see? I'll try a few things out later on and see if everything works out on my side...
I'm using Windows 7 x64 as OS, Tutorial 07 in the SDK generates the same error as mine. And the same error occurs when using reference device. I guess it is an error introduced by visual studio 11 then :(
Strangely enough the error doesn't seem to occur when using microsofts effect-framework (or atleast it doesn't on the sample I tried it on).
[font=arial, verdana, tahoma, sans-serif][size=2]Apparently visual studio 11 preview added d3dcompiler_44.dll and the current version uses d3dcompiler_43.dll, I guess that visual studio uses the wrong version of (directx-dll's) in relation to the sdk Im using. [/font]
Have you corrected the issue now? Since you are running on Win7 and not on the developer preview of Win8, then you have to make sure you are using the headers and executables from the DXSDK instead of what gets installed with VS11. The D3D11.1 headers could be the source of the trouble, so make sure your include references are setup to give the DXSDK priority over all other include sources.
Hi, I actually have the exact same error (same configuration, VS11 preview on Win7 x64). However, it seems that if you don't enable the debug layer, the problem goes away (InputLayoutCreation returns S_OK, and everything is fine: in PIX, the InputLayout is what is expected). What is even stranger, is that shader reflection still works fine, and loading offline compiled shaders seem to exhibit the same problem, so this seems to point to a corruption at the debug layer level (however, I don't have the skills in assembly to understand what's happening).
By the way, Jason, I am using your library (Hieroglyph) and it's really great. I just have some minor gripes in some places (why using a custom TArray or a custom math library?), but in general it just works fine, so thanks!

Have you corrected the issue now? Since you are running on Win7 and not on the developer preview of Win8, then you have to make sure you are using the headers and executables from the DXSDK instead of what gets installed with VS11. The D3D11.1 headers could be the source of the trouble, so make sure your include references are setup to give the DXSDK priority over all other include sources.


No, I haven't solved it yet. How do I setup so that the DXSDK gets priority over other include sources? At the moment I have simply added the path of the DXSDK in the VC++ Directories.

In the meantime I did as Razispio and disabled the debuglayer.
I think that it already compiles against the installed version of directx in the SDK as I also tried compiling and linking against the newer versions (44) with the new toolchain (vc11). It does compile, but fails miserably at run time when it cannot load D3DCompiler_44.dll or D3DX11_44.dll. However, the d3dsdklayers.dll does not seem versioned this way, so this may be the problem (but I will have to investigate more).

This topic is closed to new replies.

Advertisement