While looking at skinned mesh shaders one idea struck me. Bone indices and weights are sent per vertex as 4-byte floats, such as below:
struct VSIn
{
float3 mPosition : POSITION;
float3 mNormal : NORMAL;
// ...
float4 mBoneIndices : BONEINDICES;
float4 mBoneWeights : BONEWEIGHTS;
};
It seems awfully wasteful to send bone indices as full 4-byte floats when in reality each value is probably up for 4 and would thus all easily fit into one float.
Same (probably?) applies to weights which i don't *think* needs all the fractions provided by 4-byte float?
When looking at MSDN docs it seems the smallest scalar type is 4 bytes, there is a half-float but only for backwards compatability? Likewise there dosn't seem to be any bitwise operators in HLSL.
If bandwidth is such a precious resource is there some clever trick to pack the vertex attributes tighter and ultimately is it worth the effort?