0
votes

Does input order for a SM 4.0 vertex shader matter?

e.g. is

struct App2VS
{
    float3 position : POSITION;
    float4 color : COLOR0;
    float3 normal : NORMAL;
        ...
};

equivalent to

struct App2VS
{
    float4 color : COLOR0;
    float3 position : POSITION;
    float3 normal : NORMAL;
        ...
};
1

1 Answers

2
votes

No it shouldn't matter. The mapping information is performed by the Input Layout.

Essentially the input layout maps a given struct element to a specific input "register". These input registers are then used to load the struct used by HLSL. The HLSL struct is not a real memory mapping as those input register (ie POSITION or COLOR0) are not actual memory locations.