locked
Detect Shader Model available on hardware

    Question

  • I'd like to render differently depending on hardware capability, but Googling and browsing docs I have not been able to find any relevant functionality in DirectX 11. Specifically I want to /not/ render something if the hardware only supports SM 2.0 because of the 64 instruction limit.

    Friday, July 27, 2012 10:57 AM

Answers

  • Worked out a solution, replaced the use of "pass an array of feature levels", with trying to initialise at each feature level manually and keeping track.

    Seems like a crappy solution though - I sort of expect there is clean functionality for doing this in the library somewhere and the docs are unusually letting me down.

    Friday, July 27, 2012 1:18 PM
  • When you know the Feature Level, you know the Shader Model.

    11_11 11_0 10_1 10_0 9_3 9_2 9_1
    Shader Model 5.02 5.02 4.x 4.0 2.0 (4_0_level_9_3) [vs_2_a/ps_2_b] 2.0 (4_0_level_9_1) 2.0 (4_0_level_9_1)

    http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876(v=vs.85).aspx


    C++ DX11

    Saturday, July 28, 2012 12:19 PM
  • The D3D11CreateDevice function has an output parameter that will provide you with the featurelevel that was successfully chosen during creation.  Passing in the full array of feature levels results in the same behavior as your custom solution.  The D3D11CreateDevice function would attempt to create a device for each feature level in the order that they are provided.  Upon success, it'll fill in the pFeatureLevel out parameter.

    Subsequently, you can also call ID3D11Device::GetFeatureLevel  to see what the supported feature level is.

    • Marked as answer by Semi Essessi Sunday, August 19, 2012 7:57 AM
    Monday, July 30, 2012 6:19 PM

All replies