DX11 broken on latest 2.1

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
Post Reply
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 600
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 2
Contact:

DX11 broken on latest 2.1

Post by AshMcConnell » Wed Jan 03, 2018 4:45 pm

Hi Folks,

I have come across an error that happens in the tutorials as well as my own game. There are a number of these errors in the log file: -

Code: Select all

15:43:17: OGRE EXCEPTION(-2147467262:RenderingAPIException): Cannot reflect D3D11 high-level shader Ogre/Compositor/Quad_vs_HLSL in D3D11HLSLProgram::compileMicrocode at C:\Dev\3rdParty\cmake\Ogre\RenderSystems\Direct3D11\src\OgreD3D11HLSLProgram.cpp (line 575)
15:43:17: High-level program Ogre/Compositor/Quad_vs_HLSL encountered an error during loading and is thus not supported.
Eventually it ends in an exception (that I get when running the tutorials in DX11)

Code: Select all

15:43:18: OGRE EXCEPTION(5:ItemIdentityException): Cannot find best technique for material 'Ogre/DPSM/CubeToDpsm' in CompositorPassQuad::CompositorPassQuad at C:\Dev\3rdParty\cmake\Ogre\OgreMain\src\Compositor\Pass\PassQuad\OgreCompositorPassQuad.cpp (line 101)
It runs fine with GL3+

Thanks!
Ash
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3472
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 64
Contact:

Re: DX11 broken on latest 2.1

Post by dark_sylinc » Wed Jan 03, 2018 10:47 pm

Hi,

I could not repro your problem. My testing environments were:

x86
Visual Studio 2008
DirectX June 2010 SDK
Running on Windows 10 ver. 1703 15063.786 (x64)

x64
Visual Studio 2015
Windows SDK version 10.0.14393.0 to target Windows 10.0.15063
Running on Windows 10 ver. 1703 15063.786 (x64)

The kind of error you are seeing suggest some DLL mismatch. It's possible that:
  • Your PC got a severe misconfiguration (DirectX) or one of the latest Windows 10 updates broke things (again)
  • Your build is targetting a Windows / DirectX version newer than the one installed in your system. Run Windows Update.
  • Your Build system is kapput. Like for example mixing VS 2015 with the June 2010 SDK, or something like that. Or the Windows SDK from two different versions are being mixed. This is more likely.
I suggest you clear the whole CMake build folder and build it again. There were recent changes in how DirectX11 is found in CMake, and if you updated from an old version it's possible settings got mixed up.

If deleting the build folder entirely and regenerating CMake from scratch again doesn't solve the problem, try checking commits before these changes to find the culprit.
1 x

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 600
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 2
Contact:

Re: DX11 broken on latest 2.1

Post by AshMcConnell » Sun Jan 07, 2018 11:33 am

Sorry I haven't had a chance to look at my env yet. I will hopefully get a chance today. Thanks for the tip, I wouldn't have thought of it (as I haven't manually updated any SDKs).

Thanks!
Ash
0 x

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 600
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 2
Contact:

Re: DX11 broken on latest 2.1

Post by AshMcConnell » Sun Jan 07, 2018 9:40 pm

I have managed to track it down to a single commit. Strange thing is that all the DirectX 11 entries are the same before and after the commit. I must be missing something.

The samples work if I switch to a previous commit. I tried switching back and forth a couple of times, so there must be something in that commit that my env is not happy with. I'll try and figure it out :)

FYI: I'm on Windows 10 ver. 1703 15063.786 (x64) with Windows SDK version 10.0.10240.0 and Visual Studio 2017 Community Edition
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1044
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 27

Re: DX11 broken on latest 2.1

Post by al2950 » Wed Jan 10, 2018 10:07 pm

the cmake script is a bit broken for me, and looking at it, it may work for some but not others depending what SDKs you have installed, what your environment is targeting and what Ogre decides to use! And when I say not work I mean not compile, but I guess could cause runtime issues in theory....

If using the Windows SDKs for directX you should not be including the the full path. It would be equivalent to including the full path to windows.h. So if using windows SDKs for directX then DirectX11_INCLUDE_DIRS should be blank, DirectX11_LIBRARIES should be 'd3d11.lib dxgi.lib dxguid.lib'

Looking at the Cmake, its half way their, but seems to do something different if it finds a win 10 SDK which I dont really understand. Ill try and look back at the commits and understand if its covering an odd edge case.
1 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3472
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 64
Contact:

Re: DX11 broken on latest 2.1

Post by dark_sylinc » Wed Jan 10, 2018 11:19 pm

Ah... you're saying two different Windows SDKs are being mixed? (one for Windows.h and stuff, another for DX stuff)
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1044
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 27

Re: DX11 broken on latest 2.1

Post by al2950 » Thu Jan 11, 2018 9:58 am

dark_sylinc wrote:
Wed Jan 10, 2018 11:19 pm
Ah... you're saying two different Windows SDKs are being mixed? (one for Windows.h and stuff, another for DX stuff)
In short yes. Although its not really one for windows and one for directX, its just mixing 2 different windows SDKs, or 'Windows kits.

Its fairly obvious in VS2017 because you have to select the 'Windows SDK version' on other version of VS its not so obvious. One of my builds (Win7 VS2013) Ogre includes 'C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um' and similar libs, but Visual studio is using the win 8.1 SDK and bad things happen including mixing headers
1 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1044
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 27

Re: DX11 broken on latest 2.1

Post by al2950 » Fri Jan 12, 2018 12:10 pm

Any chance someone can have a go at fixing this, as Ogre build is effectively broken at the moment! Happy to create a pull request for what I understand, but not sure why there are different logic for windows phone, and different logic between win 10 SDKs and win 8 SDK..?

My version just looks to see if a Windows Kit is installed if so just list the libs needed to link to, if not found then then look for the June 2010 SDK and add the include dir and full path of libs to link to.
1 x

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 600
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 2
Contact:

Re: DX11 broken on latest 2.1

Post by AshMcConnell » Sun Jan 14, 2018 9:02 pm

Thanks al2950, I managed to get the latest commit compiling and demos running by manually selecting DX11 to match the targeted Windows SDK version (In Configuration Properties -> General -> Windows SDK Version).

I'm not sure what the best solution would be for the CMAKE file. How is the SDK version selected in cmake?

Unfortunately MYGUI is now not compiling (issues with OGRE_MUTEX), but hopefully I can fix it with a fresh head tomorrow

Thanks!
Ash
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1044
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 27

Re: DX11 broken on latest 2.1

Post by al2950 » Yesterday, 2018 6:04 pm

Well I have created a pull request that works nicely on all the different versions of windows and VS I have :D
3 x

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 600
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 2
Contact:

Re: DX11 broken on latest 2.1

Post by AshMcConnell » Yesterday, 2018 6:07 pm

Good work! 😀
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1044
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 27

Re: DX11 broken on latest 2.1

Post by al2950 » Yesterday, 2018 7:18 pm

Yay, merged already. Fastest PR ever! Now, as dark_sylinc said in PR, lets hope this works for all windows dev environments :roll:.

Please report any issues here, or link other post that have issues here so I am aware and ill try and understand and fix.
2 x

Post Reply