Vertex data default value? RRS feed

  • General discussion

  • Vertex Layout in CPP

    D3D11_INPUT_ELEMENT_DESC tangentspacevertexlayout[] =



           {"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;}



    B. In DXSDK  2010:
    VS_INPUT  { float4 position;} //position.w is default 1.0 ?



    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?

    Sunday, April 1, 2012 4:08 PM

All replies

  • B is faster, but does metro support B? 


    Monday, April 2, 2012 8:46 AM
  • B is OK in metro as I tested on my NV GTX570
    • Edited by Raptor K Monday, April 2, 2012 9:02 AM
    Monday, April 2, 2012 9:01 AM