Directx 11, DirectX 9, and legacy hardware

Started by
4 comments, last by noodleBowl 10 years, 6 months ago
I have been wondering about this for a while, should I be using DirectX 11 or DirectX 9?

Assuming all types of hardware is what I want to target which version of DirectX should I be using?

I think DirectX 11 can be set to use DirectX 9, but does this mean that I have to do double the programming?

Something like if we cant use DirectX 11 then use all code that makes DirectX 9 devices and uses DirectX 9 draw functions?
Advertisement
DirectX 9 is outdated but has the best hardware and OS support.
DitectX11 supports fallback on old Dx9 and DX10 hardware. You can set concrete features level and write your application by means of restricted DX11 library.

The key deciding factor here should be: do you want to run on Windows XP?

Feeding into that is: do you actually need to run on Windows XP, and nobody but yourself can answer that; you really need to profile your target audience, gain an understanding of what kind of OS and hardware they have, what kind they're likely to have when you actually release, and are you prepared to lose whatever percentage are still on XP (if that percentage is low enough it can be a reasonable trade-off).

Assuming that you don't need to run on XP, no, you don't have write everything twice. The same D3D11 API can target D3D9 class hardware, but with a reduced feature set. Commonly what you'll do is either write to the lowest-common-denominator (which you'd be doing if using 9 anyway) or write alternative render paths for some of your stuff, such as a high-quality path (for D3D10/11 hardware) and a low-quality path (for D3D9 hardware). But the basics - loading textures, creating buffers, issuing draw calls - remains the same in both cases.

Be aware that D3D11's feature level 9 only goes up to shader model 2 - that's a good deal more restrictive than what you'd get if using D3D9 itself, so that may also tilt your decision.

Also be aware that your stated objective of "all types of hardware is what I want to target" is completely unrealistic. You're still occasionally going to find people out there with cruddy old GeForce 4 MXs, for example, and wanting to include those is just going to unreasonably constrain your own work (no pixel shaders, two texture stages). It's perfectly reasonable to set a lower-bound below which you will not go, and nowadays good lower-bounds seem to be D3D9/SM3 (low-end/old hardware), D3D10 (low/mid) or D3D11 (mid/high).

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

The key deciding factor here should be: do you want to run on Windows XP?

Feeding into that is: do you actually need to run on Windows XP, and nobody but yourself can answer that; you really need to profile your target audience, gain an understanding of what kind of OS and hardware they have, what kind they're likely to have when you actually release, and are you prepared to lose whatever percentage are still on XP (if that percentage is low enough it can be a reasonable trade-off).

Assuming that you don't need to run on XP, no, you don't have write everything twice. The same D3D11 API can target D3D9 class hardware, but with a reduced feature set. Commonly what you'll do is either write to the lowest-common-denominator (which you'd be doing if using 9 anyway) or write alternative render paths for some of your stuff, such as a high-quality path (for D3D10/11 hardware) and a low-quality path (for D3D9 hardware). But the basics - loading textures, creating buffers, issuing draw calls - remains the same in both cases.

Be aware that D3D11's feature level 9 only goes up to shader model 2 - that's a good deal more restrictive than what you'd get if using D3D9 itself, so that may also tilt your decision.

Also be aware that your stated objective of "all types of hardware is what I want to target" is completely unrealistic. You're still occasionally going to find people out there with cruddy old GeForce 4 MXs, for example, and wanting to include those is just going to unreasonably constrain your own work (no pixel shaders, two texture stages). It's perfectly reasonable to set a lower-bound below which you will not go, and nowadays good lower-bounds seem to be D3D9/SM3 (low-end/old hardware), D3D10 (low/mid) or D3D11 (mid/high).


Answers like yours are an asset to us all. Thumbs up.

The key deciding factor here should be: do you want to run on Windows XP?

Feeding into that is: do you actually need to run on Windows XP, and nobody but yourself can answer that; you really need to profile your target audience, gain an understanding of what kind of OS and hardware they have, what kind they're likely to have when you actually release, and are you prepared to lose whatever percentage are still on XP (if that percentage is low enough it can be a reasonable trade-off).

Assuming that you don't need to run on XP, no, you don't have write everything twice. The same D3D11 API can target D3D9 class hardware, but with a reduced feature set. Commonly what you'll do is either write to the lowest-common-denominator (which you'd be doing if using 9 anyway) or write alternative render paths for some of your stuff, such as a high-quality path (for D3D10/11 hardware) and a low-quality path (for D3D9 hardware). But the basics - loading textures, creating buffers, issuing draw calls - remains the same in both cases.

Be aware that D3D11's feature level 9 only goes up to shader model 2 - that's a good deal more restrictive than what you'd get if using D3D9 itself, so that may also tilt your decision.

Also be aware that your stated objective of "all types of hardware is what I want to target" is completely unrealistic. You're still occasionally going to find people out there with cruddy old GeForce 4 MXs, for example, and wanting to include those is just going to unreasonably constrain your own work (no pixel shaders, two texture stages). It's perfectly reasonable to set a lower-bound below which you will not go, and nowadays good lower-bounds seem to be D3D9/SM3 (low-end/old hardware), D3D10 (low/mid) or D3D11 (mid/high).

This was a perfect explanation. Thank you!

This topic is closed to new replies.

Advertisement