Ogre`s Windows 8 UI Style port (now commited to OGRE!)

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.
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Sun Aug 12, 2012 10:20 pm

Assaf Raman wrote:Eugene ... can you sign the contributor forum and send it back to me - so we can use it in the main trunk?
I`m already signed it in 2008 as far as I remember, see "Yeugen Golushkov (eugene_gff)" line in the AUTHORS file.
Assaf Raman wrote: BTW: If we save the binary version of the shader, why not save the D3DReflect results as well? Shouldn't be hard at all and will be better performance and more reliable then the code you wrote, right?
Reflection info is laid down in compiled shader file in very straightforward manner - structures on disk and in memory are almost always identical. So, developing another serialization format for D3DReflect information (with at least variable length strings for semantics, input/output/constant buffers descriptions and so on) is not necessary easier than partially support existing. Performance would be better if reflection info would not be duplicated, reliability can be ensured by comparing results of emulated D3DReflect calls with native ones in debug builds.
Assaf Raman wrote: Eugene - What is the status with my summer student project, is all your code merged into his repo?
I saw merging efforts and than saw some of bugfixes were rolled back. In any case, I need a solid foundation for my project (Live Interior 3D), therefore I can say that https://bitbucket.org/eugene_gff/ogre-winrt is tested as good as I can in both Win32 and WinRT modes, both CMake building process and runtime behavior of SampleBrowser. I can not say this about summer project, as it`s hard to follow: all winrt related commits were smashed into two or three megacommits than parts of code were commented, uncommented and commented again - it`s not stable enough for my purposes.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Mon Aug 13, 2012 1:35 am

I worked today on getting your code to work. Regarding the reflection - I hope you will see that my solution is better when it is completed.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Mon Aug 13, 2012 7:28 am

Assaf Raman wrote:I worked today on getting your code to work. Regarding the reflection - I hope you will see that my solution is better when it is completed.
May be. Microsoft recommends exactly your approach
http://social.msdn.microsoft.com/Forums ... 00a4ab1926
Chuck Walbourn - MSFT wrote:One solution can be to have the 'runtime' compliation locally generate a cache of shader objects as you use and test your application. You then save off the cache of compiled shader blobs as a file and then ship it in the 'final' version of your application. This is the approach used by the Unreal Engine for example since all the shader generation is very 'artist driven'.

The new complication for Metro style application is that you also need to "cache" any shader metadata you require to use the shader blobs as well since the D3Compiler_*.DLL also includes the shader reflection APIs.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Mon Aug 13, 2012 7:31 am

I wrote the "cache the reflection data" code in just a few hours. You can view it on the summer project repo.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Mon Aug 13, 2012 10:06 am

Assaf Raman wrote:I wrote the "cache the reflection data" code in just a few hours. You can view it on the summer project repo.
What do you think about the idea to write another RTSS program generator that uses shader linking approach to cope with combinatorial explosion and avoid runtime shader compilation at all?
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Mon Aug 13, 2012 10:51 am

I don't like it, the RTSS and also the compiler optimizes the shaders in ways you will lose with that approach.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Mon Aug 13, 2012 12:18 pm

Assaf Raman wrote:I don't like it, the RTSS and also the compiler optimizes the shaders in ways you will lose with that approach.
Yes, but this linking is still occurred on intermediate language level, and driver specific optimizations still occurs after it, during runtime translation from intermediate language to the videocard specific code. So it`s not like virtual functions that can not be inlined and so on - linking is static rather than polymorph and all optimizations are still possible. And it is not a replacement for RTSS`s HLSL program writer, but an additional "binary-HLSL" program writer for those applications that still needs the ability to use fixed function shaders unknown at build time on a platforms that forbids runtime shader compilation.

In our project - Live Interior 3D we choose to precompile some amount of uber-shaders, but linking such shaders from separate building blocks can be interesting alternative.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Mon Aug 13, 2012 12:25 pm

Is there currently any way to run projects on windows 8 arm hardware with win8?
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Mon Aug 13, 2012 12:34 pm

Assaf Raman wrote:Is there currently any way to run projects on windows 8 arm hardware with win8?
There are no "Win8 ARM" emulator, only remote debugging on real device. And there are no real devices in the wild. No luck.
0 x

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Mon Aug 13, 2012 2:11 pm

Hmm, dynamic shader linking is SM5.0 feature and can be unavailable for devices with lower feature levels, as Intel HD3000 located inside SandyBridge processor.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Sat Aug 18, 2012 10:28 pm

Assaf Raman wrote:Eugene and Cygon, can you sign the contributor forum and send it back to me - so we can use it in the main trunk?

Cygon - can you change the license for your reflect code to be the same as OGRE - else - it will be hard for me to integrate it to the official trunk. BTW: If we save the binary version of the shader, why not save the D3DReflect results as well? Shouldn't be hard at all and will be better performance and more reliable then the code you wrote, right?

Eugene - What is the status with my summer student project, is all your code merged into his repo?
Cygon - can you sign the contributor forum? - you don''t need to change the license for your reflect code - as I didn't use it in the end.
This is the last thing that keeps me from committing the summer project code and this port code.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Sat Aug 18, 2012 11:28 pm

Cygon - never mind, I looked at the commits - I don't see anything by you. Thanks. Sorry for the misunderstanding.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Tue Aug 21, 2012 10:22 am

Code is in the trunk, Eugene - can you have a look?
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Tue Aug 21, 2012 10:30 am

Assaf Raman wrote:Code is in the trunk, Eugene - can you have a look?
Yes, of course. I`m already found some bugs during review, so I`ll post patches here or may be push them to the cloned repo.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Tue Aug 21, 2012 10:32 am

Fork the repo on bitbucket(easy to do) - and fix there, tell me when you want to merge.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port

Post by Assaf Raman » Tue Aug 21, 2012 1:50 pm

Make sure to work with the 1.9 branch.
BTW: The shader cache now also caches the data needed from the reflection - so you can compile a version without the compile and reflect - just create an new cache and then compile a version with D3D11HLSLProgram::compileMicrocode commented out, and remove d3dcompiler.lib from the link additional dependencies.

Note - I will add code in the future to support cache from two features levels to the same cache, for now you can use two cache files - according to the hardware features level.

BTW: Does your product now work with max feature level 9.1?
0 x
Watch out for my OGRE related tweets here.

User avatar
Cygon
Halfling
Posts: 70
Joined: Thu Nov 07, 2002 9:36 pm
Location: Germany
Contact:

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Cygon » Tue Aug 21, 2012 5:06 pm

Yep, I'm still on it (can only commit serious time during the weekends).

Will anything change for me when I commit my changes? Currently, I have pulled Eugene's BitBucket repository -- should I take my changes to Ogre directly or first add them to Eugene's repository?

@Assaf: Thanks, I'll send in the contributor agreement before that
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Tue Aug 21, 2012 5:24 pm

What are your changes?
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Tue Aug 21, 2012 5:39 pm

Cygon wrote:Yep, I'm still on it (can only commit serious time during the weekends).
Will anything change for me when I commit my changes? Currently, I have pulled Eugene's BitBucket repository -- should I take my changes to Ogre directly or first add them to Eugene's repository?
It seems that Assaf did the trick using method recommended by MS (manually storing required information without trying to parse metadata in shader).
0 x

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port

Post by Eugene » Tue Aug 21, 2012 6:02 pm

Assaf Raman wrote:Fork the repo on bitbucket(easy to do) - and fix there, tell me when you want to merge.
Here is what I found so far: https://bitbucket.org/eugene_gff/ogre-p ... changesets
Project was tested on the RTM version of the Win8 (no changes) and VS2012 (minor tweaks)
Also I talk with CMake developers to simplify bootstrapping process: http://www.cmake.org/Bug/view.php?id=12930#bugnotes
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Tue Aug 21, 2012 9:45 pm

Why did you remove my new exception code from OgreD3D11RenderSystem.cpp?
It makes a much better message then the current one...
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Eugene » Wed Aug 22, 2012 7:56 am

Assaf Raman wrote:Why did you remove my new exception code from OgreD3D11RenderSystem.cpp?
It makes a much better message then the current one...
It`s catches and rethrows the same exception type for every render operation, and on x86 exceptions has price even if they are not thrown, as exceptions are not table based. Also, rethrowing exceptions hides original place of error - if exception would be unhandled and crash the program, than stack log would be truncated at the place of the catch/rethrow point, that is not good for investigation, and for large projects its not always possible to set breakpoint at exception throwing due to the huge amount of the false positives, and filtering exceptions by the type in breakpoint while possible on VS is unavailable on Mac for example.

As the only side effect is modified message I thought that it was accidentally left debug code. May be it`s possible to make better messages in the first place, or return catch/rethrow code only under #ifdef DEBUG, if you really want it?
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Wed Aug 22, 2012 9:53 am

I accept. Let me think more about it.
0 x
Watch out for my OGRE related tweets here.

User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
Contact:

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Wolfmanfx » Wed Aug 22, 2012 11:20 am

I have a problem you modified the FindDirectX.cmake to search here C:/Program Files (x86)/Windows Kits/8.0

Code: Select all

  # Windows 8 SDK has custom layout
  set(DirectX_INC_SEARCH_PATH 
    "C:/Program Files (x86)/Windows Kits/8.0/Include/shared"
    "C:/Program Files (x86)/Windows Kits/8.0/Include/um"
  )
  set(DirectX_LIB_SEARCH_PATH 
    "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um"
  )

  create_search_paths(DirectX)
  # redo search if prefix path changed
  clear_if_changed(DirectX_PREFIX_PATH
    DirectX_LIBRARY
	DirectX_INCLUDE_DIR
  )
  
  find_path(DirectX_INCLUDE_DIR NAMES d3d9.h HINTS ${DirectX_INC_SEARCH_PATH}) #this do not contain a D3DX 
The problem i have now is that the dx9 rs use D3DX which must be used from the old downloadable sdk -> http://msdn.microsoft.com/en-us/library ... 85%29.aspx
So atm its not compilable (dx9)
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: Ogre`s Windows 8 Metro Style port (now commited to OGRE!

Post by Assaf Raman » Wed Aug 22, 2012 11:24 am

How do we fix this?
0 x
Watch out for my OGRE related tweets here.

Post Reply