In DirectX11, when creating a Shader Resource View to a buffer; we have to fill in the D3D11_BUFFER_SRV
structure.
The structure looks like this:
typedef struct D3D11_BUFFER_SRV {
union {
UINT FirstElement;
UINT ElementOffset;
};
union {
UINT NumElements;
UINT ElementWidth;
};
} D3D11_BUFFER_SRV;
I can't seem to find any documentation on which field in each union I'm supposed to use and when, or even really what they mean. The MSDN page (http://msdn.microsoft.com/en-us/library/windows/desktop/ff476094%28v=vs.85%29.aspx) gives a fairly obvious description of each field, but nothing much helpful.