[Closed] Lags on macOS

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Lags on macOS

Postby Hedda Pickdale » Sun Jul 08, 2018 2:22 pm

Hi there!
Since version 3.4.0, any game/mod I try to run, starts with lags. I've found a workaround to go to resolution settings, change the resolution to any other and then pack to the main one (1920x1080), but it's pretty annoying. First I though it was the mods, but the same thing happens with pure Doom/Doom 2/FreeDoom game on clean config (default settings).
Version 3.3.2 has no such issues, only versions 3.4.0 and 3.4.1

Running on:
macOS 10.13.5
NVidia GTX 650
with OpenGL renderer.

If there's any logs I should provide, I'll do it gladly.

Regards,
Philip
Hedda Pickdale
 

Re: Lags on macOS

Postby _mental_ » Sun Jul 08, 2018 2:35 pm

What’s the Mac model?

If you have integrated Intel graphics, I suggest you to switch to it by setting vid_autoswitch CVAR to zero.
Have no idea how Apple managed to do that but sometimes GZDoom works faster than with discrete one.
You can try to switch off Retina/HiDPI support in Video mode menu too.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Lags on macOS

Postby Hedda Pickdale » Sun Jul 08, 2018 3:08 pm

It's this one:
https://everymac.com/systems/apple/imac ... specs.html
and it has only external graphics.
Already tried to disable the Retina/HiDPI support, but it had no effect.
Hedda Pickdale
 

Re: Lags on macOS

Postby _mental_ » Sat Jul 14, 2018 6:51 am

I managed to reproduce the problem.

For unknown reason glUnmapBuffer() took up to 200 ms while on the same hardware and OS it should be less than 1 ms.
Indeed, it gets back to such timings after changing the current resolution.

Apparently it's a bug. The thing is I really don't know why it works fine on integrated graphics and fails on discrete one.
We can blame Apple's OpenGL drivers as usual but I hope to find some workaround for this issue.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Lags on macOS

Postby _mental_ » Sat Jul 21, 2018 2:59 am

The issues was introduced with this commit which is an essential part of indexed vertex buffer usage for flats rendering.
Honestly I have no idea why it causes such horrendous lags on macOS.
But the strangest thing in this bug is the workaround.

If GZDoom is started as usual (without mods or with a mod that doesn't have title map), each frame takes up to 500 ms to render.
If the game is started with +map ... command line (or with a title map), the issue doesn't appear.
Moreover, integrated Intel graphics seem to be unaffected by this thing at all. Only discrete one exhibits the huge difference in performance.

Ideas are welcome. I tried to play with usage arguments of glBufferData in gl_vertexbuffer.cpp but this didn't change anything. Or perhaps I didn't manage to find the right combination.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Lags on macOS

Postby Graf Zahl » Sat Jul 21, 2018 3:19 am

_mental_ wrote:The issues was introduced with this commit which is an essential part of indexed vertex buffer usage for flats rendering.
Honestly I have no idea why it causes such horrendous lags on macOS.


In this case there's a sad conclusion here: The vertex cache being used by indexed rendering seems to be broken somehow and it needs some secondary effects to get on the right track.
To me it looks like a driver bug (figures, considering we are talking about the duo from hell here - Apple and AMD...)
Solution: Contact drfrag to provide a legacy build that still uses the old subsector-based renderer.
I guess for macOS we need the Vulkan renderer even more than for the other platforms - what an irony considering that it has no native Vulkan support...
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Lags on macOS

Postby drfrag » Sat Jul 21, 2018 3:43 am

Graf Zahl wrote:Solution: Contact drfrag to provide a legacy build that still uses the old subsector-based renderer.

Of course i don't own a Mac but _mental_ has access to my repo, i added him as collaborator long ago.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: Lags on macOS

Postby _mental_ » Sat Jul 21, 2018 4:08 am

Actually, I don't want to provide legacy builds for macOS at all.
I would like to act the same as Apple did, to deprecate as much as possible.
And if something doesn't work I'll say that you simply don't need it :)

Back to the topic, it was GeForce 650M but yeah, Apple managed to screw up almost everything.
Anyway, there is the mentioned workaround which I hope will give some hints how to "fix" it.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Lags on macOS

Postby Graf Zahl » Sat Jul 21, 2018 4:30 am

_mental_ wrote:Actually, I don't want to provide legacy builds for macOS at all.
I would like to act the same as Apple did, to deprecate as much as possible.


I'm afraid, but with that you'll have to wait until Vulkan works. Until then it's just hoping and praying that the deprecated stuff continues to work.
Apple's OpenGL is already a legacy component because it doesn't support anything of what's considered "modern", so providing only a legacy build seems fitting somehow.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Lags on macOS

Postby _mental_ » Sat Jul 21, 2018 4:44 am

The thing is builds from master branch work fine for me. Outside of this issue I see no problems with them.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Lags on macOS

Postby drfrag » Sat Jul 21, 2018 4:57 am

May be i have no idea of what i'm talking about but could be that something bad happens to the vertex cache while on the title screen (or something good does not happen).
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: Lags on macOS

Postby Graf Zahl » Sat Jul 21, 2018 5:11 am

Apparently. But the title screen only draws some indexed primitives as well.
Have you tried disabling the wipe or changing its mode?
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Lags on macOS

Postby _mental_ » Sat Jul 21, 2018 5:31 am

Sure, changing or disabling wipe had no effect. Sorry, I should mention this before.
Also, menu and console operates with no lags before the game is started. Moreover, wipe is rendered smoothly and then the issue begins.
_mental_
 
 
 
Joined: 07 Aug 2011


Return to Closed Bugs

Who is online

Users browsing this forum: ZzZombo and 1 guest