Page 1 of 1

[SOLVED] Problem with DirectX 11 not firing up

Posted: Tue Mar 12, 2013 12:56 pm
by Ange44
Hi,

We have a project using Ogre that works perfectly on all the computers we have tried so far using DirectX9. We have also a version using DirectX11 that work on some computers and does not on other ones and we cannot figure out where the problem is and what is missing...

Here is the spec on the computer I am using at the moment:
DirectX11 runtime installed
DirectX SDK June 2010 installed
Quadro 2000 with latest drivers freshly installed

Whenever I fire the application I got the error

Code: Select all

11:51:42: D3D11 : Subsystem Initialising
11:51:42: OGRE EXCEPTION(7:InternalErrorException): Failed to create Direct3D11 object in D3D11RenderSystem::D3D11RenderSystem at C:\Metropolis1.5\Metro_v1.5_working\Dependencies src\Ogre\RenderSystems\Direct3D11\src\OgreD3D11RenderSystem.cpp (line 641)
I have the exact similar problem on another computer with a GeForce GTX 285, but it works on other computers with different graphic cards.

Would anyone have an idea what's going on?

Cheers

Ludovic

Re: Problem with DirectX 11 not firing up

Posted: Tue Mar 12, 2013 5:44 pm
by lunkhound
I just had a similar problem myself. I found this thread http://stackoverflow.com/questions/1058 ... ith-e-fail helpful.
The failure was only happening in debug builds when the deviceFlags parameter was set to D3D11_CREATE_DEVICE_DEBUG. Apparently the latest DXSDK (June 2010) doesn't inlcude the debug layer, so you need to install that separately.
As a quick hack fix I commented out the line in OgreD3D11RenderSystem.cpp that set that flag, and got things working. Or just use the Release build.

Re: Problem with DirectX 11 not firing up

Posted: Tue Mar 12, 2013 6:12 pm
by Ange44
That's the thing, it's happening both in Debug and Release...

And I tried the Directx SDK June 2010 samples and DX11 demos work...

Re: Problem with DirectX 11 not firing up

Posted: Tue Mar 12, 2013 7:26 pm
by lunkhound
Must be something else then. How up to date is your version of Ogre? There has been alot of work on the DX11 render system in the v1-9 branch.
Do any of the Ogre samples run with DX11 for you?

Re: Problem with DirectX 11 not firing up

Posted: Tue Mar 12, 2013 11:05 pm
by robert_sasu
First, reply to Ange44: that error probably happened because you had a system (platform) update for windows 7. I have got the same problem, last week, when windows updated some of the DirectX11 dll files, and the function names where not more equal. And this is why Ogre can't create DirectX 11 object. It doesn't work if you reinstall the DirectX 11 - it wasn't working for me. The only way I could resolve it was by upgrading my Visual Studio to 2012 and build Ogre again. All of this because of the platform update. Probably you have done the platform update on some of the PCs and not in all of them.
If you want to get a working DX11 render system you have to work with the latest code version of the v1-9 branch, or if you want even more samples to work for you take the changesets done to DX11 render system in my repo.

If you have any other questions, do it :)

Re: Problem with DirectX 11 not firing up

Posted: Thu Mar 14, 2013 9:05 pm
by cvanbrederode
Ange44 wrote:That's the thing, it's happening both in Debug and Release...

And I tried the Directx SDK June 2010 samples and DX11 demos work...
I'm having the same problem, also in Release build. Looking through the code, I found that at line 551 of OgreD3D11RenderSystem.cpp, deviceFlags is being setup like this:

Code: Select all

			UINT deviceFlags = 0;
			if (D3D11Device::D3D_NO_EXCEPTION != D3D11Device::getExceptionsErrorLevel())
			{
				deviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
			}
			if (!OGRE_THREAD_SUPPORT)
			{
				deviceFlags |= D3D11_CREATE_DEVICE_SINGLETHREADED;
			}
			D3D_DRIVER_TYPE driverType = D3D_DRIVER_TYPE_UNKNOWN ;
...for a call to D3D11CreateDevice() on line 632; which is where I'm getting my exception is being thrown.

deviceFlags is setup again more than once later on, but it is configured like this (from line 2871):

Code: Select all

		UINT deviceFlags = 0;
		if (D3D11Device::D3D_NO_EXCEPTION != D3D11Device::getExceptionsErrorLevel() && OGRE_DEBUG_MODE)
		{
			deviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
		}
		if (!OGRE_THREAD_SUPPORT)
		{
			deviceFlags |= D3D11_CREATE_DEVICE_SINGLETHREADED;
		}
I notice that where I'm having a problem, the code is missing the "&& OGRE_DEBUG_MODE", so the call at line 632 is always being setup with D3D11_CREATE_DEVICE_FLAG, even in Release builds.

I added "&& OGRE_DEBUG_MODE to where it was "missing" and it cleared up the exception in my case.

Re: Problem with DirectX 11 not firing up

Posted: Fri Mar 15, 2013 5:04 pm
by Ange44
@cvanbrederode: Thanks a mill cvanbrederode, that solved my problem. I added your fix and recompiled Ogre, and that's working perfectly. Thanks for the hand!

Re: [SOLVED] Problem with DirectX 11 not firing up

Posted: Sat Mar 16, 2013 12:17 am
by drwbns
@cvanbrederode Did you file a bug for this?

Re: [SOLVED] Problem with DirectX 11 not firing up

Posted: Thu Oct 24, 2013 8:57 am
by Jedzia
drwbns wrote:@cvanbrederode Did you file a bug for this?
When searching after problems, unanswered questions at the end of a [Solved] Topic are irritating.

Code: Select all

            if (D3D11Device::D3D_NO_EXCEPTION != D3D11Device::getExceptionsErrorLevel() && OGRE_DEBUG_MODE)
            {
                deviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
            }
is in the actual head of the source repository.

Is it legitimate to do,

Code: Select all

            if (D3D11Device::D3D_NO_EXCEPTION != D3D11Device::getExceptionsErrorLevel() && OGRE_DEBUG_MODE)
            {
                //deviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
            }
(and the same in the second place later)
when i am too lazy to install the Windows 7 Platform SDK?