Light Creation/Deletion Performance Bug

Problems building or running the engine, queries about how to use features etc.
paroj
OGRE Team Member
OGRE Team Member
Posts: 2126
Joined: Sun Mar 30, 2014 2:51 pm
x 1140

Re: Light Creation/Deletion Performance Bug

Post by paroj »

I ported your shaders to unified to do some tests on GL3+.

I noticed that on D3D11 any performance difference vanishes if you remove the [unroll] directive:
https://github.com/paroj/ogre/commit/f2 ... 2980c9aR85

the performance is then at the lower (~ 1000fps) level. On GL3+ the FPS is always at this level.

The UBO update might also trigger a shader recompile behind the scenes which somehow ignores that directive.

However, at least from my experiments this is just micro-benchmarking some driver aspect and the general performance is fine. 🤷

rpgplayerrobin
Orc Shaman
Posts: 710
Joined: Wed Mar 18, 2009 3:03 am
x 391

Re: Light Creation/Deletion Performance Bug

Post by rpgplayerrobin »

I noticed that on D3D11 any performance difference vanishes if you remove the [unroll] directive

I have also tried this, but for my computers the same bug existed with the exact same performance.
The bug still exists for me even if there is no calculations being done. This seems to be an issue only regarding the driver and how it handles changing constants.

However, at least from my experiments this is just micro-benchmarking some driver aspect and the general performance is fine.

But it does mean that your FPS can be cut in half when changing the constants, which happens between scenes if not recompiling each shader between scenes. That is a big deal of course, but it does not happen on all computers. But it is reproduceable.

I reproduced the issue outside of Ogre as well with a minimal file, and I sent a detailed report to Nvidia about the driver bug.
Here is the minimal reproduceable version outside of Ogre if needed (numlock to toggle the constants, and FPS meter in the top-left):
https://drive.google.com/file/d/1aG5NTv ... sp=sharing
All computers I have tested it on has had around 50% decrease in FPS, simply by just changing the constants.

On some computers, going between two scenes in my game can halve the FPS as well, so this is not a nit-picking issue.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2126
Joined: Sun Mar 30, 2014 2:51 pm
x 1140

Re: Light Creation/Deletion Performance Bug

Post by paroj »

I am just as curious what nvidia will reply.

On your machines it is a significant issue. However as far as I could reproduce it, it just makes a 0.3ms difference and merely brings performance down to OpenGL levels.