3

I am currently reading Frank Luna's Introduction to 3D Game Programming with DirectX 11 and have just reached the portion where I am loading my first shader.

After linking to the proper libraries to be able to compile shaders, I was forced to switch to VS 2010 toolset so my app did not try to use Windows 8.1 libraries (which include DirectX so it conflicted with my June SDK directory).

I got everything to compile just fine now, however my D3D11CreateDevice function call is now storing D3D_FEATURE_LEVEL_9_3 as my highest supported feature level. It did not do this before. I confirmed on my dxdiag.exe that my system can support 11. I've also confirmed this in the NVidia control panel, where it states DirectX Runtime version as 11_0.

From what I've been reading from other people who have been having similar problems is that their primary video adapter was the default adapter. However, I only have one adapter so my GTX 670 must be my primary adapter, right?

My Environment: Visual Studio 2013 (using VS 2010 toolset) Video Card: GEFORCE GTX 670M (dx11 capable) ASUS G75V NOTEBOOK Windows 7 64-bit

Regardless, here is my call to check to check the feature level.

// Create Direct3D Device
HRESULT hr = D3D11CreateDevice(
    0,
    D3D_DRIVER_TYPE_HARDWARE,
    0,
    createDeviceFlags,
    0, 0,
    D3D11_SDK_VERSION,
    &m_d3dDevice,
    &featureLevel,
    &m_d3dImmediateContext);

if (FAILED(hr)) {
    throw Error("Direct3D Device Creation Failed!");
}

// Check feature level
if (featureLevel != D3D_FEATURE_LEVEL_11_0) {
    throw Error("Direct3D Feature Level 11 not supported!");
}

Debugging the feature level

Any input as to what the heck is going on will be greatly appreciated. Direct3D is a fairly new world to me so please go easy.

  • 1
    It's probably the compiler you're using; MSVC 10 is considered ancient on Windows 8. The DX runtimes compiled for that version most likely cap out at DX9 since DX11 would logically take advantage of certain system capabilities only available through MSVC 12 or higher, which in turn is only supported on Vista, 7, and 8. I would look into telling the Windows 8 SDK to exclude the implicit DX libraries and use a newer compiler :) – Qix - MONICA WAS MISTREATED Nov 08 '14 at 19:32
  • 1
    Are you setting any feature level limits or overrides via dxcpl.exe? Or are you building a Windows Store app? There are tools you might be inadvertently using that force 9.3 to ensure your app runs across all devices. Other than that, there doesn't seem to be anything wrong with your code. Also, MSVC10 (assuming you mean from VS 2010) should be fine to use. – MooseBoys Nov 08 '14 at 22:30
  • I am building a Win-32 app and a static lib project.I tried my project in VS10 and the same problem persisted.I have been reading more and I think this is a common problem with NVidia laptops.When I open up "DirectX Caps Viewer," It shows the proper D3D_FEATURE level 11_0 associated with my graphics card.But when I open the other DirectX caps viewer(I have multiple EXEs of this for some reason),it shows a 9_3 capable card.I am going try something when I get the chance, involving switching my primary graphics device to my more powerful one all the time, although I thought I only had one device. – SystemsThinker Nov 08 '14 at 22:53
  • 1
    You probably have one of those NVIDIA "Optimus" steps that keeps trying to make you use the Intel onboard integrated part. Use the NVIDIA control panel to override this behavior. – Chuck Walbourn Nov 09 '14 at 05:03
  • I read on NVIDIA and appearently my graphics card, GTX 670m doesn't support optimus. This is proven by me trying to install drivers and failing. I just tried EnumAdapters1 in practically a while loop, and the best coming up is 9_3. I guess i will just have to develop on a different machine or something.. :( – SystemsThinker Nov 09 '14 at 15:38

1 Answers1

2

I had the same problem on Windows 8.1 with ATI Radeon 6xxx graphics card. Caps viewer reported feature level 11_2 while the D3D11CreateDevice returned a device with max level 9_3.

Finally I found that I have installed DirectX SDK June 2010. Uninstalling it solved the problem.