Reputation: 3567
I submitted a question that was actually a bunch of questions in one, so i'm splitting them into their own separate questions, as requested.
just a general question about direct3D, if i was to write an application entirely in d3d11 with hlsl 5.0 shaders, will these still be compatible with only d3d10 or d3d9 capable systems, just with less graphically pleasing effects and the efficiency of d3d11? If so, how much less efficient would it be? If not, would i seriously need to make 2 or 3 different versions of the exact same program, except using d3d9, d3d10, and d3d11?
Upvotes: 2
Views: 2617
Reputation: 551
It is backward compatible to a certain degree. However there are few things to keep in mind:
To sum this up, using DX11 somewhat makes sence if your target platform is DX10.0+-class hardware (because aside from HW tesselation, differences are tolerable and/or there are workarounds for missing features). If you want to support DX9 HW, I'd suggest you to stick to DX9 SDK as this will allow you to run your app on XP.
Upvotes: 3
Reputation: 2976
I don't believe the previous comment is entirely accurate.
You might need to install the DX11 runtime onto the target machine, but you should be able to create a D3D11Device on any card that is DX9+ hardware compatible.
But that doesn't really get you much, because you need to pass in a list of feature levels you support (or NULL which implies a list) and the function has an out parm telling you what feature level you got. So a DX9 only card would come back with D3D_FEATURE_LEVEL_9_1 (or 9_2/9_3).
The feature level in turn lets you know what chunk of d3d11 is available to you and how it will behave ( http://msdn.microsoft.com/en-us/library/windows/desktop/ff476150(v=vs.85).aspx and http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876(v=vs.85).aspx )
The quick take-away from those charts is that DX11 is probably fine for covering DX10 and DX11 devices. It could also be fine for DX9 /depending/ on if you want/need those features.
Compute Shaders mostly work on DX10 hardware (http://msdn.microsoft.com/en-us/library/windows/desktop/ff476873(v=vs.85).aspx)
Upvotes: 2
Reputation: 175
No, it is not backwards compatible. If you want to run on more platforms, a directX11 capable graphics card will certainly support directx9. So either develop one time in DX9, or in both DX11 and DX9.
Upvotes: 1