Original Post
The docs say the following:
But, does Direct3D 10+ define the behavior if the shader input signature only contains a subset of the input-layout? For example, suppose I have my usual mesh vertex structure, say for example:
struct Vertex
{
Vector3 Pos;
Vector3 Normal;
Vector3 UV;
};
but I want to draw depth only to a render target. The shader signature for the depth shader only needs the POSITION vertex attribute:
struct VS_IN
{
float3 Pos : POSITION;
};
Is it defined in Direct3D the behavior if I reuse the input layout corresponding to Vertex? Is it equivalent to defining:
struct VS_IN
{
float3 Pos : POSITION;
float3 Normal : NORMAL;
float2 UV : TEXCOORD;
};
and just ignoring Normal and UV in the depth pass?
Quote:
You can create a single input-layout object for many shaders, as long as all of the shader-input signatures exactly match.
But, does Direct3D 10+ define the behavior if the shader input signature only contains a subset of the input-layout? For example, suppose I have my usual mesh vertex structure, say for example:
struct Vertex
{
Vector3 Pos;
Vector3 Normal;
Vector3 UV;
};
but I want to draw depth only to a render target. The shader signature for the depth shader only needs the POSITION vertex attribute:
struct VS_IN
{
float3 Pos : POSITION;
};
Is it defined in Direct3D the behavior if I reuse the input layout corresponding to Vertex? Is it equivalent to defining:
struct VS_IN
{
float3 Pos : POSITION;
float3 Normal : NORMAL;
float2 UV : TEXCOORD;
};
and just ignoring Normal and UV in the depth pass?