Vertex data default value?
-
domingo, 1 de abril de 2012 16:08
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?
- Editado Raptor K domingo, 1 de abril de 2012 16:15
- Editado Raptor K domingo, 1 de abril de 2012 16:18
- Editado Raptor K segunda-feira, 2 de abril de 2012 04:40
- Editado Raptor K segunda-feira, 2 de abril de 2012 04:56
- Editado Raptor K segunda-feira, 2 de abril de 2012 04:57
- Editado Raptor K segunda-feira, 2 de abril de 2012 04:59
- Editado Raptor K segunda-feira, 2 de abril de 2012 11:43
- Tipo Alterado Matt SmallMicrosoft Employee, Moderator quarta-feira, 4 de abril de 2012 15:54

