XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Using D3D10_SIGNATURE_PARAMETER_DESC to partially populate D3D10_INPUT_ELEMENT_DESC

Last post 04-24-2008 2:46 PM by John Rapp. 2 replies.
  • 04-23-2008 7:28 PM

    Using D3D10_SIGNATURE_PARAMETER_DESC to partially populate D3D10_INPUT_ELEMENT_DESC

    Hi,

    I notice that the D3D10_SIGNATURE_PARAMETER_DESC structure has SemanticName and SemanticIndex members. These members seems identical to the members of D3D10_INPUT_ELEMENT_DESC structure. It seems tempting to programatically derive SemanticName, SemanticIndex, and Format members of D3D10_INPUT_ELEMENT_DESC from D3D10_SIGNATURE_PARAMETER_DESC. However, the D3D10_SIGNATURE_PARAMETER_DESC does not seem to contain any information about the format of the input. I can only find a register type of the input signature, without the length of the input. (Or is there?)

    Can I  derive D3D10_INPUT_ELEMENT_DESC from D3D10_SIGNATURE_PARAMETER_DESC, without manually setting the Format member? Should I even try it?


    Thanks,
  • 04-24-2008 11:21 AM In reply to

    Re: Using D3D10_SIGNATURE_PARAMETER_DESC to partially populate D3D10_INPUT_ELEMENT_DESC

    There is a Mask field in D3D10_SIGNATURE_PARAMETER_DESC that you can use to get the number of elements in a vertex attribute vector for example for a scalar it has to be (00000001) for float2 (00000011) for float3 (00000111) etc. 
  • 04-24-2008 2:46 PM In reply to

    Re: Using D3D10_SIGNATURE_PARAMETER_DESC to partially populate D3D10_INPUT_ELEMENT_DESC

    You'll also want to look at the component type to know if it's an integer or float format. Presumably this really should be driven the other way, though, and you should be altering your signatures to match your mesh input, not the other way around.
Page 1 of 1 (3 items) Previous Next