What you pass through has to match what the shader expects to receive.
If the shader expects 2x Vector4 values per vertex (1 for position and 1 for color), then you need to supply that.
Different shaders can expect different things, for example a single vector position, and the color hard coded in the shader.
struct VS_IN
{
float4 pos : POSITION;
float4 col : COLOR;
};
Your vertex shader is expecting 8 floats(2x float4) per vertex, as mentioned above, and this is where that information was dictated. if you do not follow the signature of the shader bad ju ju will follow. In dx9 this meansgarbage in garbage out. In dx10 and later, they got smart by forcing a validation with an input signature when compiling a shader. This is your layout parameter above as well. the shader signature, input layout, and vertex data must match if the shader has any hope of doing something with that data other than mangling it.