Fix: DEG: Image updates are flushed for initial evaluation #115240
No reviewers
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#115240
Loading…
Reference in New Issue
No description provided.
Delete Branch "OmarEmaraDev:fix-depsgraph-flush-editors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Visibility updates as part of the first depsgraph evaluation when
data-blocks first become visible are flushed to editors for Image IDs.
A check does exist to avoid flushing in those cases, however, it uses
the COW expanded status of the ID, which fails for IDs that do not use
COW.
This patch fixes that by explicitly passing the original value of the
graph visibility update flag before getting reset, which is then used in
the aforementioned check.
This changes the logic from "inform editors about ID change on next evaluation after it was fully evaluated" to "inform editors about ID changes on a second depsgraph evaluation after it was tagged for visibility updates". From intuitive understanding of the code this means that with the proposed change adding cube to scene will immediately inform editors about change.
What does this patch address on user level? Knowing that would help thinking of a better solution.
Yah, sorry, my knowledge of the depsgraph is not great.
Well, I was just trying to handle the comment:
On the user level, when the user edits a compositor node tree that contains an Image node that references an image ID, that image ID will get its reclac flag set due to it "becoming visible" when refreshing the compositor's depsgraph. The image ID didn't change, yet its reclac flag says it changed, which the problem I am trying to solve.
@Sergey This is what happens when I edit a node tree that contains an image node, evem though the image itself didn't change. Notice:
And:
Depsgraph debug output:
I think there are two things here then:
flush_editors_id_update
.The first one is annoying, but it is not the place where image is tagged. For the compositor depsgraph the
deg_editors_id_update
is not executed because compositor's depsgraph is not the active one.The second one seems to be much more important in the context of avoiding unneeded updates on compositoor depsgraph changes. A quick test for whether it is the case would be to do something like this in
graph_tag_ids_for_visible_update
(or something similar):If that helps performance, then we can look into correctness of such change and do tweaks if needed.
@Sergey I see. But to clarify, the performance improvement in my case is indirect, since the superfluous tag invalidates the image cache every time the compositor executes, which defies the point of the cache.
That change looks like it will alleviate the problem, but I will confirm it in a bit.
The little code snippet does produce the intended outcome in my use case.
Good to know!
I'll need to double-check, but I think we can actually skip such depsgraph tags on graph creation for all IDs which are not covered by the COW.
Pull request closed