0
\$\begingroup\$

I'm writing an application that targets Direct3D11 (through SlimDX) and shader model 5.

When I'm running it on a system that doesn't have SM5 capable hardware, I will get a NullReferenceException when trying to access the techniques in the compiled effect instance.

How can I check if the adapter is capable of this before I even attempt to use any of these features?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You can check the FeatureLevel property of the Device object. If it returns Level_11_0 then it means that the hardware supports SM5.

\$\endgroup\$
1
  • \$\begingroup\$ Awesome. Now I also see that I can provide an array of acceptable feature levels right in the Device.CreateWithSwapChain call. \$\endgroup\$ Aug 13, 2013 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .