Lags on macOS

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Guest

Lags on macOS

Post by Guest »

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
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Lags on macOS

Post by _mental_ »

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.
Guest

Re: Lags on macOS

Post by Guest »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Lags on macOS

Post by _mental_ »

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_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Lags on macOS

Post by _mental_ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Lags on macOS

Post by Graf Zahl »

_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
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Lags on macOS

Post by drfrag »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Lags on macOS

Post by _mental_ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Lags on macOS

Post by Graf Zahl »

_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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Lags on macOS

Post by _mental_ »

The thing is builds from master branch work fine for me. Outside of this issue I see no problems with them.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Lags on macOS

Post by drfrag »

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Lags on macOS

Post by Graf Zahl »

Apparently. But the title screen only draws some indexed primitives as well.
Have you tried disabling the wipe or changing its mode?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Lags on macOS

Post by _mental_ »

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.
Post Reply

Return to “Closed Bugs [GZDoom]”