Performance fix for Win8 [2.2.2]

Performance fix for Win8 [2.2.2]
0.0 0


If you have been porting your game to Windows 8 Surface Pro, you probably noticed performance were pretty bad. Default examples projects run fine as they don’t render much.

The fix is to switch the DX feature level to DX9.1 in:
CCEGLView.cpp, WinRTWindow::Initialize

#if (_MSC_VER >= 1800)
    // WinRT on Windows 8.1 can compile shaders at run time so we don't care about the DirectX feature level

It was initially set to ANGLE_D3D_FEATURE_LEVEL_ANY, which will default to DX11.
Our first thought about this was that the Surface Pro probably revert back to software rendering mode. But performance would have been a lot worse. I think it’s just the way AngleProject make use of DX9 vs DX11, and that DX9 is a bit more aligned with OpenGL ES in term of state changes and such.

For us we drastically improved performance just by changing that flag. Some scenes we had like 25 FPS, went up to solid 60.

Hope that this post will be of great help for everyone porting on Win8. We spent a week of trying to figure out how to gain performance. We even implemented more aggressive sprite batching in the engine! (Which we won’t share, because it’s not very pretty code… And now irrelevent)