I am relevantly new to Graphics Programming. I have written some basic games in xna in the past but I am trying to understand what the point of all these surface formats is. For instance Xna and DDS support the standard RGBA (8bpp). Why does one need 32 bpp or even stranger combinations of bits per channel like Rg32. Isn't it enough to have the standard DXn, RGBA, and HDR formats?
Joking aside, I suspect the reason has to do with a combination of legacy/backwards compatibility and flexibility.
Obviously, once a surface format is introduced it needs to be supported forward for some time, or the entire API takes a backwards compatibility hit. So there are probably a few surface formats that float about just due to that reason alone.
But the bigger reason is the flexibility that is afforded to developers by having many surface format options to choose from -- this allows developers to do things like use as few bits as possible for a particular channel, or as few channels as possible for scenarios where optimizing space is an important consideration. It allows for the possibility of expanding to very large bit-widths when broad ranges of color data are going to be required (for example, for HDR, as you mentioned). Some formats exist for relatively specialized (but very common, possibly performance critical graphics operations) tasks -- the
Some of the strange looking formats can be useful for non-graphics operations, too, like general GPU computation where you may only need two channels of input data (and thus, why waste space on the third when that video memory could be put to better use -- such as allowing more of the two-channel data you're trying to process?)
Having a variety of formats also allows the developer to communicate to the GPU how the data will be arranged and used (this is why the DXGI format list is so big, because it not only includes bit-width variations, but some type information as well, such as whether the values will be signed or unsigned), which in turn can allow the GPU to optimize its buffer layouts for maximum pipeline throughput.
Finally, some of the formats are restricted in where and when they can be used, which necessitates a list that may seem sprawling at first, but is actually relatively compact for any given scenario. Relatively few formats can be used for a depth buffer, for example.