Geometry Nodes: Avoid geometry copies in "no cache" simulation #109742

Merged
Hans Goudey merged 9 commits from HooglyBoogly/blender:simulation-avoid-copies into main 2023-07-11 14:03:18 +02:00
Member

When we don't need to preserve a persistent cache, we can use
the geometry from the last frame directly rather than copying it.
Though implicit lets us avoid copying large data arrays when they
aren't changed, this can still give a large improvement for something
like particle simulation where the majority of the data was copied
every frame.

Depends on #109741

When we don't need to preserve a persistent cache, we can use the geometry from the last frame directly rather than copying it. Though implicit lets us avoid copying large data arrays when they aren't changed, this can still give a large improvement for something like particle simulation where the majority of the data was copied every frame. Depends on #109741
Hans Goudey added 3 commits 2023-07-05 15:14:39 +02:00
67f93da4d9 Fix #109462: Incorrect "No Cache" simulation cache invalidation
The "No Cache" simulation nodes option effectively changes the cache
to work in a "realtime mode" where there are only two states, the
current and previous frame. Whenever the current frame doesn't
increase, the previous state should reset. This didn't happen
properly, and it was hard to verify because the code was shared
with the regular "cache on" mode.

Instead, separate the caching more in the code, usin a different
struct to store the two "realtime" states. Also clarify that we
don't support animation of the "No Cache" option by disabling
support for that in RNA.
buildbot/vexp-code-patch-coordinator Build done. Details
d4af732202
Fix compile error
c947f7d6c1 Geometry Nodes: Avoid geometry copies in "no cache" simulation
When we don't need to preserve a persistent cache, we can use
the geometry from the last frame directly rather than copying it.
Though implicit lets us avoid copying large data arrays when they
aren't changed, this can still give a large improvement for something
like particle simulation where the majority of the data was copied
every frame.

Depends on #109741
Hans Goudey added 3 commits 2023-07-10 17:24:34 +02:00
Hans Goudey requested review from Jacques Lucke 2023-07-10 17:24:54 +02:00
Hans Goudey added this to the Nodes & Physics project 2023-07-10 17:25:29 +02:00
Member

@blender-bot build

@blender-bot build
Jacques Lucke approved these changes 2023-07-11 12:59:12 +02:00
@ -88,0 +81,4 @@
}
/* When caching is turned off and the old state doesn't need to persist, moving data
* from the last state instead of copying it can avoid copies of geometry data arrays. */
if (auto *state = modifier_data.prev_simulation_state_mutable) {
Member

It seems like the check for mutability should come first. This is important when both prev_simulation_state_mutable and prev_simulation_state are set.

It seems like the check for mutability should come first. This is important when both `prev_simulation_state_mutable` and `prev_simulation_state` are set.
HooglyBoogly marked this conversation as resolved
Hans Goudey added 3 commits 2023-07-11 14:02:52 +02:00
Hans Goudey merged commit 424c6edc53 into main 2023-07-11 14:03:18 +02:00
Hans Goudey deleted branch simulation-avoid-copies 2023-07-11 14:03:20 +02:00
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 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#109742
No description provided.