Undo takes several seconds just to move default cube within scene containing panorama if viewport shows materials #90593

Closed
opened 2021-08-10 22:56:47 +02:00 by Robert Bragg · 18 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71

Blender Version
Broken: version: 2.93.2, branch: master, commit date: 2021-08-03 05:58, hash: 1eb06de260
Broken: version: 2.93.1, branch: master, commit date: 2021-06-22 05:57, hash: 1b8d33b18c
Worked: It sometimes works ok in 2.83.16, but not consistently

Short description of error
If a scene has any materials with large textures then it seems that any undo operation can be very slow (several seconds) if the viewport is currently displaying materials, but the same operation will undo instantly if the viewport is flat shaded or wireframe.

Even if the operation (such as grabbing and moving a default, untextured, cube) is unrelated to any materials involving large textures the undo is still very slow.

Exact steps for others to reproduce the error

  • Keep the default cube
  • Add a UV sphere and scale it 100x
  • Create a material shader with nodes for the sphere like:

(Environment Texture)[Color] => [Color](Emission Shader)[Emission] => [Surface](Material Output)

  • Associate a large environment map image with the texture node (e.g. 8k)

  • Make sure the Viewport Shading mode is set to 'Material Preview'

  • Select the default cube in object mode

  • Press 'g' to grab and move the cube

  • Press Ctrl-Z to undo

This undo is taking about 2 seconds to complete for me. In my original project I was seeing undo taking between 3-6 seconds.

(I can also attach a minimal .blend file that is based on default/factory settings that reproduces this)

Notably I found that if I follow the same instructions to reproduce this in 2.83 then I didn't initially see any lag with undo, but if I save the file, close blender and then re-open then I would see the same issue.

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71 **Blender Version** Broken: version: 2.93.2, branch: master, commit date: 2021-08-03 05:58, hash: `1eb06de260` Broken: version: 2.93.1, branch: master, commit date: 2021-06-22 05:57, hash: `1b8d33b18c` Worked: It _sometimes_ works ok in 2.83.16, but not consistently **Short description of error** If a scene has any materials with large textures then it seems that any undo operation can be very slow (several seconds) if the viewport is currently displaying materials, but the same operation will undo instantly if the viewport is flat shaded or wireframe. Even if the operation (such as grabbing and moving a default, untextured, cube) is unrelated to any materials involving large textures the undo is still very slow. **Exact steps for others to reproduce the error** - Keep the default cube - Add a UV sphere and scale it 100x - Create a material shader with nodes for the sphere like: (Environment Texture)[Color] => [Color](Emission Shader)[Emission] => [Surface](Material Output) - Associate a large environment map image with the texture node (e.g. 8k) - Make sure the Viewport Shading mode is set to 'Material Preview' - Select the default cube in object mode - Press 'g' to grab and move the cube - Press Ctrl-Z to undo This undo is taking about 2 seconds to complete for me. In my original project I was seeing undo taking between 3-6 seconds. (I can also attach a minimal .blend file that is based on default/factory settings that reproduces this) Notably I found that if I follow the same instructions to reproduce this in 2.83 then I didn't initially see any lag with undo, but if I save the file, close blender and then re-open _then_ I would see the same issue.
Author

Added subscriber: @RobertBragg

Added subscriber: @RobertBragg

#89127 was marked as duplicate of this issue

#89127 was marked as duplicate of this issue

#86273 was marked as duplicate of this issue

#86273 was marked as duplicate of this issue
Author

slow-undo-depending-on-viewport-mode-packed.blend
Here's a minimal blend file, based on factory default settings that reproduces the issue for me, created with blender 2.93.2. It includes a highly compressed panorama jpg that's 10k by 5k

[slow-undo-depending-on-viewport-mode-packed.blend](https://archive.blender.org/developer/F10276873/slow-undo-depending-on-viewport-mode-packed.blend) Here's a minimal blend file, based on factory default settings that reproduces the issue for me, created with blender 2.93.2. It includes a highly compressed panorama jpg that's 10k by 5k
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Can confirm the behavior.

But since blender Global Undo works by somewhat reading a whole blend file from memory, this might be expected/unavoidable.
@mont29: sorry to ask, but is this expected behavior?

Can confirm the behavior. But since blender Global Undo works by somewhat reading a whole blend file from memory, this might be expected/unavoidable. @mont29: sorry to ask, but is this expected behavior?

Added subscribers: @fclem, @Jeroen-Bakker

Added subscribers: @fclem, @Jeroen-Bakker

That would be more of a question for #eevee_viewport team I think... Sounds like some GPU work caching gets lost. @Jeroen-Bakker ? @fclem ?

That would be more of a question for #eevee_viewport team I think... Sounds like some GPU work caching gets lost. @Jeroen-Bakker ? @fclem ?

@lichtwerk Global undo only reads modified data (in ideal world at least) these days, so would expect it to be possible to keep unmodified data's GPU caches ;)

@lichtwerk Global undo only reads modified data (in ideal world at least) these days, so would expect it to be possible to keep unmodified data's GPU caches ;)
Member

In #90593#1206179, @mont29 wrote:
@lichtwerk Global undo only reads modified data (in ideal world at least) these days, so would expect it to be possible to keep unmodified data's GPU caches ;)

I am so not "up-to-date" on this, sorry spreading some non-truth here!

> In #90593#1206179, @mont29 wrote: > @lichtwerk Global undo only reads modified data (in ideal world at least) these days, so would expect it to be possible to keep unmodified data's GPU caches ;) I am so not "up-to-date" on this, sorry spreading some non-truth here!
Member

Issue is related to undo file loading.
After the file is linked the caches are cleared.
This is done in image_blend_read_lib.

After discussing with @mon29 we propose to clear the attributes when writing that are also cleared during load. This would lead to reuse of the existing image.

Issue is related to undo file loading. After the file is linked the caches are cleared. This is done in `image_blend_read_lib`. After discussing with @mon29 we propose to clear the attributes when writing that are also cleared during load. This would lead to reuse of the existing image.
Member

Added subscriber: @rfc

Added subscriber: @rfc

I tested it in 2.91 it works very good without lag even if you restart it several times

I tested it in 2.91 it works very good without lag even if you restart it several times

This issue was referenced by 0896457c59

This issue was referenced by 0896457c59d722e809188517c042b57d0ea399d3

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'
Bastien Montagne self-assigned this 2021-08-19 18:01:34 +02:00

@Jeroen-Bakker 0896457c59 Fixed most of the problem, but the first undo step (immediately after fileload) still forces reloading of the image data-block, apparently because the preview sub-data changes. Not sure I'd consider that a real bug though, more like known internal limitation.

@Jeroen-Bakker 0896457c59 Fixed most of the problem, but the first undo step (immediately after fileload) still forces reloading of the image data-block, apparently because the `preview` sub-data changes. Not sure I'd consider that a real bug though, more like known internal limitation.

Added subscribers: @Andrei-Feheregyhazi, @Alaska, @Zandman, @iss

Added subscribers: @Andrei-Feheregyhazi, @Alaska, @Zandman, @iss
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
Interest: X11
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
7 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#90593
No description provided.