How do you use Directx Feature levels?

Started by
0 comments, last by MJP 12 years, 4 months ago
How exactly are you supposed to use the feature level functionality of DX11?

Would you have to take note of what feature level was returned from D3D11CreateDevice() and then depending on that, have different paths for all your code? So if a dx9 device had been returned, load a completely different set of shaders that don't use any dx10 or dx11 functionality?

That seems like a real headache.
Advertisement
Yes, that is one thing you can do with the feature levels. You can also just check the feature level of the device being returned, and return an error if it is below your supported feature level. So if you don't want to support DX9 GPU's, then you require a minimum feature level of 10. You can also specify which versions you want when creating the device, so that you can restrict yourself to a lower feature set. So if you wanted you could just work at feature level 10, and ignore higher feature levels.

If you're going to support a range of feature levels, usually the only practical way to do it is to author most of your functionality for the lowest common denominator and then add in a few extra shaders/features that are only active for higher feature levels. Having different code paths for everything just isn't really scalable. Even the big AAA games usually work this way.

This topic is closed to new replies.

Advertisement