[SOLVED] Problem with DirectX 11 not firing up

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
Ange44
Gnoblar
Posts: 15
Joined: Tue Feb 26, 2008 6:14 pm

[SOLVED] Problem with DirectX 11 not firing up

Post by Ange44 » Tue Mar 12, 2013 12:56 pm

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
Last edited by Ange44 on Fri Mar 15, 2013 5:04 pm, edited 1 time in total.
0 x

User avatar
lunkhound
Gremlin
Posts: 169
Joined: Sun Apr 29, 2012 1:03 am
Location: Santa Monica, California

Re: Problem with DirectX 11 not firing up

Post by lunkhound » Tue Mar 12, 2013 5:44 pm

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.
0 x

Ange44
Gnoblar
Posts: 15
Joined: Tue Feb 26, 2008 6:14 pm

Re: Problem with DirectX 11 not firing up

Post by Ange44 » Tue Mar 12, 2013 6:12 pm

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...
0 x

User avatar
lunkhound
Gremlin
Posts: 169
Joined: Sun Apr 29, 2012 1:03 am
Location: Santa Monica, California

Re: Problem with DirectX 11 not firing up

Post by lunkhound » Tue Mar 12, 2013 7:26 pm

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?
0 x

User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 238
Joined: Mon Apr 02, 2012 11:07 am

Re: Problem with DirectX 11 not firing up

Post by robert_sasu » Tue Mar 12, 2013 11:05 pm

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 :)
0 x
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
cvanbrederode
Gnoblar
Posts: 9
Joined: Thu Feb 21, 2008 4:10 pm
Location: Mechanicsburg, PA
Contact:

Re: Problem with DirectX 11 not firing up

Post by cvanbrederode » Thu Mar 14, 2013 9:05 pm

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.
0 x
Chris Van Brederode

Ange44
Gnoblar
Posts: 15
Joined: Tue Feb 26, 2008 6:14 pm

Re: Problem with DirectX 11 not firing up

Post by Ange44 » Fri Mar 15, 2013 5:04 pm

@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!
0 x

drwbns
Orc Shaman
Posts: 777
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California

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

Post by drwbns » Sat Mar 16, 2013 12:17 am

@cvanbrederode Did you file a bug for this?
0 x

Jedzia
Gnoblar
Posts: 2
Joined: Wed Oct 23, 2013 12:30 pm

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

Post by Jedzia » Thu Oct 24, 2013 8:57 am

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?
0 x

Post Reply