AMD OpenGL performance

Everything about development and the OpenMW source code.
Post Reply
raven
Posts: 66
Joined: 26 May 2016, 09:54

AMD OpenGL performance

Post by raven »

There have been quite a few posts about low frame rates with AMD cards. I've got one around and thought to have a look.

In the start region I am getting 45-75 fps on my system (Win7x64).

Running the game in gDEBugger I see about 55fps.

Looking at call counts, there are a bit more than 1000 draw calls per frame, so OpenMW doesn't seem to be draw call limited. Disabling all draw calls increases the framerate to 65fps.

The biggest call counts go to glLightfv 1820(1156 effective calls) and glLightf 1575(320 effective calls). It is possible to disable fixed function lighting, which increases the framerate to 60fps. Although gDEBugger doesn't remove the now completely redundant glLight calls, so no idea how much overhead they are causing.

There are also 3 glGetError calls per frame. Those can stall the GPU. Unfortunately I can't disable them to see how much effect they have.

So the game seems to be CPU limited in general.

To anyone seeing large fps drops with AMD, feel free to share your savegames (assuming vanilla configuration). Maybe we can figure out together what is going on.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: AMD OpenGL performance

Post by scrawl »

To disable glGetError checking you set the environment variable OSG_GL_ERROR_CHECKING=OFF.
raven
Posts: 66
Joined: 26 May 2016, 09:54

Re: AMD OpenGL performance

Post by raven »

OSG_GL_ERROR_CHECKING=OFF doesn't seem to work in conjunction with gDEBugger, might be a gDEBugger issue though. Would be nice if the debugger allowed to skip certain call types, but oh well...

Is there eventually a simple way to disable lighting setup from the engine side, just to see how it performs without all those glLight calls?
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: AMD OpenGL performance

Post by scrawl »

OSG_GL_ERROR_CHECKING=OFF doesn't seem to work in conjunction with gDEBugger, might be a gDEBugger issue though. Would be nice if the debugger allowed to skip certain call types, but oh well...
You can set environment variables within gdebugger in the project's "Debug settings". These may override environment variables you have set in the OS.
Is there eventually a simple way to disable lighting setup from the engine side, just to see how it performs without all those glLight calls?
You'd need to recompile the engine.

Code: Select all

diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp
index c237f23..12d326e 100644
--- a/apps/openmw/mwrender/renderingmanager.cpp
+++ b/apps/openmw/mwrender/renderingmanager.cpp
@@ -243,7 +243,7 @@ namespace MWRender
         mViewer->getCamera()->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
         mViewer->getCamera()->setCullingMode(cullingMode);
 
-        mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor|Mask_SimpleWater));
+        mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor|Mask_SimpleWater|Mask_Lighting));
 
         mNearClip = Settings::Manager::getFloat("near clip", "Camera");
         mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");
raven
Posts: 66
Joined: 26 May 2016, 09:54

Re: AMD OpenGL performance

Post by raven »

scrawl wrote:You can set environment variables within gdebugger in the project's "Debug settings". These may override environment variables you have set in the OS.
That was the first option I've tried.
You'd need to recompile the engine.
I was afraid I'd have :)
Post Reply