Direct3D compatibility issues with older graphic cards.

Hello!

I'am quite new to C++, Win32 API and DirectX (Direct3D). While I tested some code from a Direct3D 11 tutorial, I found out that my graphic card wasn't compatible with Direct3D. I know that I can set the feature level down, or compile my project in reference mode, but the Direct3D 11 tutorials in the DirectX SDK works perfectly fine on my computer, even though my graphic card doesn't support Direct3D 11. How is this possible? And even though the program manages to set down the feature level to fit my graphic card, there would still be parts of the code that just work with Direct3D 11, wouldn't it?

Basically, my question is: How can I make my Direct3D 11 code compatible with older graphic cards?
While I tested some code from a Direct3D 11 tutorial, I found out that my graphic card wasn't compatible with Direct3D

Did you try downloading the latest drivers?

but the Direct3D 11 tutorials in the DirectX SDK works perfectly fine on my computer, even though my graphic card doesn't support Direct3D 11. How is this possible?

I suppose the tutorials could work if they use basic, vanilla Direct3D features.

there would still be parts of the code that just work with Direct3D 11, wouldn't it?

It stands to reason that only new features added in D3D 11 will not work if the card doesn't support D3D 11. The other features would still work contingent on the maximum supported D3D level of the graphics card.

How can I make my Direct3D 11 code compatible with older graphic cards?

As you said, set the feature level down. If the card doesn't support D3D 11, then the new features won't work. You could also query the D3D level of the graphics card programatically. If the card supports D3D 11, then use a D3D 11 code path, otherwise go down a D3D 10 (or 9) code path.
Did you try downloading the latest drivers?

Yes, I did, but I would anyway want my game to be working on GPUs supporting Direct3D 9 at least and not only newer GPUs.

As you said, set the feature level down. If the card doesn't support D3D 11, then the new features won't work. You could also query the D3D level of the graphics card programatically. If the card supports D3D 11, then use a D3D 11 code path, otherwise go down a D3D 10 (or 9) code path.

Wouldn't the completed file be much, much bigger if I had separate code snippets for different versions of Direct3D? I've read something about that you would have to use this method in older versions of Direct3D, but that in Direct3D 11, a new feature is implemented to fix this problem automatically. Do you, or anyone know anything about this?
Hopefully, this answers your question.

Wikipedia wrote:
The Direct3D 11 runtime is able to run on Direct3D 9 and 10.x-class hardware and drivers,[15] using the ​D3D10_FEATURE_LEVEL1​ functionality first introduced in Direct3D 10.1 runtime.[14] Feature levels 9_1, 9_2 and 9_3 encapsulate various features of popular Direct3D 9 cards, and feature levels 10_0 and 10.1 refer to Direct3D 10 and 10.1 respectively; each upper level is a strict superset of a lower level. Feature levels allow developers to unify the rendering pipeline under Direct3D 11 API and make use of API improvements such as better resource management and multithreading even on entry-level cards, though advanced features such as new shader models and rendering stages will only be exposed on up-level hardware.[18] [19]

So, essentially, to have your code work with older cards, lower the feature level (the feature level switch is probably the "new feature" you've read about). If your code needs newer hardware, such as for using a new shader model, you could use the programatic switching of code paths (detect if the hardware can do it. If not, render in a friendlier way).

Wouldn't the completed file be much, much bigger if I had separate code snippets for different versions of Direct3D?

Yes, there would be more code (but not much, much more if designed correctly). And, you would only need different code paths for when you're using advanced features (such as new features in higher levels of DirectX or if you're implementing shaders that older graphics cards can't handle). If your code is nothing but vanilla Direct3D (i.e. setting vertices of a bunch of models and only rotating and translating them around without doing anything special), then you wouldn't need to branch to different code paths for older hardware.
Topic archived. No new replies allowed.