WIP: Fix #119211: GPU Compositor: Masks are not updating correctly in Backdrop/Viewer Node #119561

Draft
Habib Gahbiche wants to merge 2 commits from zazizizou/blender:com-fix-mask-not-updating into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Mask operators typically call DEG_id_tag_update(&mask->id, ID_RECALC_GEOMETRY); to update the mask and they do not invalidate some GPU drawing state. This means CachedMask should query changes directly from the mask.

Downsides of this patch is that masks are currently always recalculated, even for changes that don't require it, e.g. disconnect an unrelated compositor node. This will be addressed by using more targeted ID_RECALC_* flags, should we choose to move on with this approach

Mask operators typically call `DEG_id_tag_update(&mask->id, ID_RECALC_GEOMETRY);` to update the mask and they do not invalidate some GPU drawing state. This means `CachedMask` should query changes directly from the mask. Downsides of this patch is that masks are currently always recalculated, even for changes that don't require it, e.g. disconnect an unrelated compositor node. This will be addressed by using more targeted `ID_RECALC_*` flags, should we choose to move on with this approach
Habib Gahbiche added 2 commits 2024-03-16 16:52:58 +01:00
Habib Gahbiche added this to the Compositing project 2024-03-16 16:53:11 +01:00
Author
Member

@OmarEmaraDev Is this approach fine in principle? I don't understand why images and textures get their recalc flags through DrawEngine and not directly through their id...

@OmarEmaraDev Is this approach fine in principle? I don't understand why images and textures get their `recalc` flags through `DrawEngine` and not directly through their `id`...
Member

@zazizizou This approach is not fine unfortunately.

Note that the ID->recalc flags will eventually be accumulated in the DrawData->reclac in flush_engine_data_update during dependency graph evaluation. So using DrawData->reclac instead of ID->recalc shouldn't be an issue.

The reason why every "engine" have its own reclac flags for every ID is that they will be able to clear the flags once they have handled the changes. On the other hand, if you clear the flag in the ID itself like your code currently do, other engines will miss those changes.

To debug this, we need to figure out why the flags don't propogate to the draw data. Maybe start by looking at the depsgraph log, looking for Accumulated recalc bits for?

@zazizizou This approach is not fine unfortunately. Note that the `ID->recalc` flags will eventually be accumulated in the `DrawData->reclac` in `flush_engine_data_update` during dependency graph evaluation. So using `DrawData->reclac` instead of `ID->recalc` shouldn't be an issue. The reason why every "engine" have its own reclac flags for every ID is that they will be able to clear the flags once they have handled the changes. On the other hand, if you clear the flag in the ID itself like your code currently do, other engines will miss those changes. To debug this, we need to figure out why the flags don't propogate to the draw data. Maybe start by looking at the depsgraph log, looking for `Accumulated recalc bits for`?
This pull request is marked as a work in progress.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u com-fix-mask-not-updating:zazizizou-com-fix-mask-not-updating
git checkout zazizizou-com-fix-mask-not-updating
Sign in to join this conversation.
No reviewers
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
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#119561
No description provided.