Refactor: flatten light tree in recursive function #107560

Merged
Brecht Van Lommel merged 6 commits from brecht/blender:recursive-light-tree-flatten into main 2023-05-05 16:33:06 +02:00

This will make further changes for light linking easier, where we want to build multiple trees specialized for each light linking set.

I also find it easier to understand than the stack used previously.

This will make further changes for light linking easier, where we want to build multiple trees specialized for each light linking set. I also find it easier to understand than the stack used previously.
Brecht Van Lommel added 2 commits 2023-05-02 20:55:43 +02:00
Refactor: build light tree in recursive function
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
9c69504771
To make further refactoring for linking easier. Also replace parent_index
by directly storing bit_trail.
Brecht Van Lommel requested review from Weizhen Huang 2023-05-02 20:55:51 +02:00

@blender-bot build

@blender-bot build
Weizhen Huang added 2 commits 2023-05-05 14:46:00 +02:00
Weizhen Huang approved these changes 2023-05-05 15:00:36 +02:00
Weizhen Huang left a comment
Member

Looks great! The logic is indeed much more clear now.
There was problem in the logic: the instance node and the reference node should be swapped before flattening, otherwise it will not necessarily build the subtree first. I already commited the change in cfd7de83ac.
Otherwise only minor comments regarding the function names.

Looks great! The logic is indeed much more clear now. There was problem in the logic: the instance node and the reference node should be swapped before flattening, otherwise it will not necessarily build the subtree first. I already commited the change in cfd7de83ac. Otherwise only minor comments regarding the function names.
@ -435,0 +445,4 @@
std::unordered_map<LightTreeNode *, int> instances;
};
static void light_tree_node_flatten(KernelLightTreeNode &knode,
Member

This is not a flatten operation, maybe call it something like copy_light_tree_node_to_device()?

This is not a flatten operation, maybe call it something like `copy_light_tree_node_to_device()`?
brecht marked this conversation as resolved
@ -435,0 +478,4 @@
KernelLightTreeEmitter *kemitters,
int &next_node_index);
static void light_tree_leaf_emitters_flatten(LightTreeFlatten &flatten,
Member

Similar here, it's mainly copying to device but also flattens subtree. Maybe better to rename too? Something with copy_and_flatten()

Similar here, it's mainly copying to device but also flattens subtree. Maybe better to rename too? Something with `copy_and_flatten()`
brecht marked this conversation as resolved
Brecht Van Lommel added 1 commit 2023-05-05 15:57:37 +02:00
Brecht Van Lommel added 1 commit 2023-05-05 15:59:47 +02:00
Merge branch 'main' into recursive-light-tree-flatten
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.
d5c0b766cc
Author
Owner

@blender-bot build

@blender-bot build
Brecht Van Lommel merged commit 0ffde36fe7 into main 2023-05-05 16:33:06 +02:00
Brecht Van Lommel deleted branch recursive-light-tree-flatten 2023-05-05 16:33:07 +02:00
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:42 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 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#107560
No description provided.