What is the purpose of semantics?
if I had a vertex layout like this:
struct VS_Input { float4 position : COLOR; float4 color : POSITION; };
Would it really be important for me to change the semantics to two members?
If I need to send a Direct3D structure to the top, why can't it just copy my data like?
If I provided direct3D a vertex with a layout that does not match the layout of the shader, what will happen? for example, if I pass the next vertex to the specified shader?
struct MyVertex { Vec4 pos; Vec2 tex; Vec4 col; };
The D3D documentation says that a warning will be prepared and that my data will be "reinterpreted"
Does this mean that "reinterpreted", as in reinterpret_cast <>? for example, will my shader try to use texture coordinates and half color as the color in the shader? or will he look for my vertex layout for an element that matches each semantics and moves the input to the right places to make the shader work?
And if this is not the case above, then why does D3D require an explicit vertex layout?
source share