Jump to content

  • Log In with Google      Sign In   
  • Create Account

InputLayouts


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
7 replies to this topic

#1 imoogiBG   Members   -  Reputation: 1184

Like
0Likes
Like

Posted 24 April 2013 - 11:38 AM

Hello!

 

I'm currently writing input layout manager. Well the problem is ... 

 

 

d3ddev->CreateInputLayout(inputElemDesc.get(), numSemantics, 
pShader->GetShaderBlob().GetBufferPointer(), <------------------------------------ HERE
pShader->GetShaderBlob().GetBufferLength(), 
&m_pD3D11Layout);
 
The result is 'success' against that shader :

float4 main(
): SV_Position
{
float4 retval = float4(0.f, 0.f, 0.f, 1.f);
 
return retval;   
}
 
But when i try to Draw something that error occurs : "  Signatures between stages are incompatible. The input stage requires Semantic/Index (POSITION,0) as input, but it is not provided by the output stage. "
 
inputElemDesc is containing the 'POSITION' Semantic (only) but the shader compiler is cutting it! (the format is r32g32b32_FLOAT)
 
I can't compile shaders online(because of hardware limitations), so i cannot generate dummy shader for each inputlayout... 
 
Any suggestions?
 


Sponsor:

#2 cephalo   Members   -  Reputation: 542

Like
0Likes
Like

Posted 24 April 2013 - 01:45 PM

I went through something like like this. Make sure you are using the same structs with the exact same semantics for each shader stage. I had an issue where I was toying with my vertex shader output struct and forgot to also change my other shaders to match.


Edited by cephalo, 24 April 2013 - 01:46 PM.


#3 David_pb   Members   -  Reputation: 668

Like
1Likes
Like

Posted 24 April 2013 - 02:05 PM

So, where does your shader signature require position? Are you sure you've the right shader bound to the pipeline while submitting the drawcall?


@D13_Dreinig

#4 imoogiBG   Members   -  Reputation: 1184

Like
0Likes
Like

Posted 24 April 2013 - 03:09 PM

Yes im shure that evrything about the shader and inputElementDesc is OK. The problem is that im validating the inputLayout(with position only) against the shader that doesn't require any input. The layout is created succefully. After that im using the same input layout with shader that requires POSITION . The error message is : "Signatures between stages are incompatible. The input stage requires Semantic/Index (POSITION,0) as input, but it is not provided by the output stage." 

Actually the input layout provides the position semantic, but obviously it is illigal to  validate input layout against shader without any input rquirements.
I want to find a way to validate my input layout. I think that InputLayouts must be build for the mesh object not for ther shader. That thing is driving me crazy!!!

Well actually there is one solution (witch i cannot use): to create on the fly vertex shader based no the input layout, but because of platform limitations I cannot compile shader at runtime(windows phone and (im not shure about it) Xbox). 

 



#5 eppo   Crossbones+   -  Reputation: 2458

Like
1Likes
Like

Posted 25 April 2013 - 01:26 AM

I can't compile shaders online(because of hardware limitations), so i cannot generate dummy shader for each inputlayout... 

 

Most practical method is to validate the input layout against an actual shader that uses the input layout.

 

When binding an input layout together with a vertex shader, the layout needs to have (validated) element for all the VS' input elements (matching in position and order). It can have additional element used by other shaders, but it can never omit elements required by the shader.

 

For example, if you have an input layout that's validated against a shader that uses the input elements [POSITION, NORMAL, UV], the layout can be used to feed the following shader input structs: [POSITION, NORMAL, UV] [POSITION, NORMAL] [POSITION] [-]. (You'd validate such an input layout against the shader that has the largest span of input elements.)



#6 imoogiBG   Members   -  Reputation: 1184

Like
0Likes
Like

Posted 25 April 2013 - 11:13 AM

What i've found today : http://ftscode.blogspot.com/2012/09/directx11-input-layout.html

 

 

My question is what is the price to make the vertex data binding in the openGL style(aka to bind one vertex buffer several times (see the link above))



#7 eppo   Crossbones+   -  Reputation: 2458

Like
0Likes
Like

Posted 26 April 2013 - 05:47 AM

Using multiple streams would add some overhead (for both the API and the Input Assembler). This will increase with the number of semantics used.



#8 David_pb   Members   -  Reputation: 668

Like
1Likes
Like

Posted 28 April 2013 - 11:11 AM

Splitting vertex-data in multiple streams can be very handy if you don't want to always provide the full amount of vertex information. Let's say you want to do a z-prepass, you don't need information like normal/tangent, color etc... The proposed solution however can easily result in a huge number of simultaneous bound vertex streams and thus can badly impact IA fetch performance.


@D13_Dreinig




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