Optional features with hundreds of caps bits do not a great developer experience make. How do I know which caps I need to check on which hardware? What do I do if they are not set?
Some of the caps we have today are just silly. How is a 3D game supposed to react if RasterCaps.SupportsDepthBufferTest comes back false? I don't know of any hardware that doesn't set this, but in theory some could, and what then?
An interesting exercise (well, interesting to me anyway 🙂 is to compare the caps found on actual hardware out in the wild:
If you compare the full set of caps from many graphics cards, several things become clear:
- This is a multi dimensional problem, far more complex than the above Venn diagram
- Collating that much data is REALLY REALLY BORING
- The distribution of caps is far from random
- Many caps are supported by all hardware
- Surprisingly, some caps are never supported by any hardware at all!
- There is a large bucket of caps that are supported by all "HiDef" hardware (Xbox and recent/better Windows cards), but not by older/cheaper Windows parts such as integrated laptop GPUs
- Thanks to DX10, Windows is rapidly converging toward the "HiDef" feature set (even cheap laptops support DX10 these days)
- There are remarkably few important caps that are supported by just random subsets of hardware
These findings suggest how we could simplify caps management:
- Remove all the stupid stuff that no hardware actually supports
- Collapse the remaining flags into a single enum with two values:
- Reach = "I want my game to run on as many machines as possible, so will limit myself to the features that are reliably available everywhere"
- HiDef = "I want to use more advanced things like vertex textures, MRT, and floating point surface formats, and am ok with this limiting my ability to run on less powerful hardware"
It could take just one line of code to check whether a machine supports Reach or HiDef, which makes it easier to understand what features are safe to use. This also helps when trying to create portable games. If you specify Reach profile, the framework could enforce that you don't accidentally use any HiDef functionality, thus avoiding unpleasant surprises of the "huh, that worked on my machine..." variety.