Vertex Layout in CPP
D3D11_INPUT_ELEMENT_DESC tangentspacevertexlayout[]
=
{
{"POSITION",0,DXGI_FORMAT_R32G32B32_FLOAT,0,0, D3D11_INPUT_PER_VERTEX_DATA,0},
{"TEXCOORD",0,
DXGI_FORMAT_R32G32_FLOAT, 0,12,
D3D11_INPUT_PER_VERTEX_DATA,0},
…
But The HLSL code is DIFFERENT in June.2010 DXSDK and the new metro samples.
A. In Metro DX tutorial:
VS_INPUT {
float3 position;}
mul(float4(position,1.0f),mWorld)
----------------------
B. In DXSDK
2010:
VS_INPUT {
float4 position;} //position.w
is default 1.0 ?
mul(position,mWorld)
---------------------
A has 2 more instructions than B,
mov r1.xyz,
v0.xyzx
mov r1.w,
l(1.000000)
The results are the same. Which one is better, Is B faster?
Are all devices support the default value 1.0 for undefined vector data?