Viewport and Eevee performance issues on macOS #53497

Closed
opened 2017-12-07 07:18:18 +01:00 by kevin zhow · 15 comments

Currently performance on macOS is quite bad.

The most immediately visible issue is that for the first 10s or so, both Clay and Eevee are very laggy. After that viewport navigation is much smoother, though still not great.

Currently performance on macOS is quite bad. The most immediately visible issue is that for the first 10s or so, both Clay and Eevee are very laggy. After that viewport navigation is much smoother, though still not great.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @kevinzhow

Added subscriber: @kevinzhow
kevin zhow changed title from Eevee has very laggy performance in 3D View on macOS 10.12 to Eevee has very laggy performance in 3D View on macOS 10.13.1 2017-12-07 07:20:36 +01:00
Brecht Van Lommel changed title from Eevee has very laggy performance in 3D View on macOS 10.13.1 to Viewport and Eevee performance issues on macOS 2018-04-03 16:38:34 +02:00

Removed subscriber: @kevinzhow

Removed subscriber: @kevinzhow

Added subscriber: @brecht

Added subscriber: @brecht

The cause of the initial lagging is not clear. The profile shows most of the time is spent in the driver doing shader compilation.
macOS_eevee_profile.png

It keeps doing that on every redraw, even when there are no new GLSL shaders being created and used as far as I can tell. Note that this issue also existed before lazy shader compilation was added, so it's not because of that.

When setting the viewport samples to 1 in Clay or Eevee it stops lagging much sooner, after 1s or so. My guess for what could be going on:

  • It is compiling a specialized shader for each viewport sample. If that is the case, we may be able to hint the driver not to do that.
  • Since there is still a lag for 1 viewport sample, there may also be some kind of multi-stage compilation going on where it first compiles a less optimized shader and then does deeper optimization later on, similar to how javascript is handled in browsers.
The cause of the initial lagging is not clear. The profile shows most of the time is spent in the driver doing shader compilation. ![macOS_eevee_profile.png](https://archive.blender.org/developer/F2585572/macOS_eevee_profile.png) It keeps doing that on every redraw, even when there are no new GLSL shaders being created and used as far as I can tell. Note that this issue also existed before lazy shader compilation was added, so it's not because of that. When setting the viewport samples to 1 in Clay or Eevee it stops lagging much sooner, after 1s or so. My guess for what could be going on: * It is compiling a specialized shader for each viewport sample. If that is the case, we may be able to hint the driver not to do that. * Since there is still a lag for 1 viewport sample, there may also be some kind of multi-stage compilation going on where it first compiles a less optimized shader and then does deeper optimization later on, similar to how javascript is handled in browsers.

Added subscriber: @fclem

Added subscriber: @fclem

Added subscriber: @dfelinto

Added subscriber: @dfelinto

@brecht is shader cache working in OSX? (the OS/driver one)

In other words, does it make any difference to open a file for the first time or the second time (both cases after closing and reopening blender)?

@brecht is shader cache working in OSX? (the OS/driver one) In other words, does it make any difference to open a file for the first time or the second time (both cases after closing and reopening blender)?

Shader patching is a thing! Though it seems that MacOSX opengl implement is quite aggressive with it. Maybe some branches are statically optimized by the compiler.

So maybe we need to tag them to not be optimized. Is there a macos opengl specific flag for this?

Shader patching is a thing! Though it seems that MacOSX opengl implement is quite aggressive with it. Maybe some branches are statically optimized by the compiler. So maybe we need to tag them to not be optimized. Is there a macos opengl specific flag for this?

@brecht It would be nice to know which shader is concerned!

You can try loading a blank scene (no objects) and see if there is still lag. If yes, this would mean it's a post process (TAA) problem.
But your screenshot suggest it comes from default passes. Which are geometry passes. In this case an empty scene should not lag.

@brecht It would be nice to know which shader is concerned! You can try loading a blank scene (no objects) and see if there is still lag. If yes, this would mean it's a post process (TAA) problem. But your screenshot suggest it comes from default passes. Which are geometry passes. In this case an empty scene should not lag.

I don't know if there is a shader cache on macOS, I couldn't find anything so far. There also does not appear to be a ARB_get_program_binary to cache shaders manually. I also did not find a way to tune optimization or shader patching on macOS yet.

There is no lag in an empty scene. Though of course the shaders are much simpler then so it may still be doing shader patching but fast enough not to notice.

My plan is to figure out which exact state changes are causing the shader patching.

I don't know if there is a shader cache on macOS, I couldn't find anything so far. There also does not appear to be a `ARB_get_program_binary` to cache shaders manually. I also did not find a way to tune optimization or shader patching on macOS yet. There is no lag in an empty scene. Though of course the shaders are much simpler then so it may still be doing shader patching but fast enough not to notice. My plan is to figure out which exact state changes are causing the shader patching.

I've committed a fix for the initial lagging, it was different texture slot assignments that caused shader patching.

I've committed a fix for the initial lagging, it was different texture slot assignments that caused shader patching.

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2018-08-13 14:04:27 +02:00

Archiving this for now, can be handled as part of general stability and optimization on all platforms.

Archiving this for now, can be handled as part of general stability and optimization on all platforms.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#53497
No description provided.