Page MenuHome

T77124: Remapping `RNA_path_resolve` to other ID Blocks for FCurves
Needs RevisionPublic

Authored by Jeroen Bakker (jbakker) on May 29 2020, 2:19 PM.

Details

Summary

This patch stores the done evaluation steps for an FCurve RNA path lookup inside the runtime of the FCurve.
This reduces the evaluation of fcurves. Multiple solutions have been tested including storing multiple
cache items at the end the simplest solution (single cache result) got the best performance.

This patch also introduces a more generic solution that can be applied to other locations (rna_access_cache.c)
Spring 020_02A.anim.blend went from 12.4 to 12.7 fps in AMD Ryzen 1700.

The current implementation uses a global lock as the building process during playback is most likely to be
performed from the main thread. The mutex is a just in case scenario. We might also want to remove the
mutex at all and make sure that the cache is populated on a single thread only.

There are still some clean ups to do before this patch will be send for review.

Before:

After:

The difference is that the lookup of the RNA_path in the drivers takes less time most noticeable in (BKE_animsys_eval_driver).

Diff Detail

Repository
rB Blender
Branch
arcpatch-D7875_1 (branched from master)
Build Status
Buildable 8929
Build 8929: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.May 29 2020, 2:19 PM
Jeroen Bakker (jbakker) planned changes to this revision.May 29 2020, 2:20 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)

First try on caching rna paths in the animation system

Attached to the animation system.

Rebased with latest master to continue working from office

Fixing ASAN related issues

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jun 4 2020, 3:44 PM

Fixed read from unallocated memory

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jun 4 2020, 4:40 PM
Jeroen Bakker (jbakker) retitled this revision from T77124: Research for caching RNA_path_resolve to T77124: Research for remapping `RNA_path_resolve` to other ID Blocks.Jun 4 2020, 4:46 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)

Moved code to more generic places

source/blender/blenkernel/intern/anim_sys.c
363 ↗(On Diff #25535)

Merge with BKE_animsys_store_rna_setting

576 ↗(On Diff #25535)

Merge with animsys_write_orig_anim_rna

source/blender/editors/space_graph/graph_buttons.c
384

RNAPathCache

Added multiple cache items

Preparation to shift to interp multiple fcurves at once.

Reduced complexity

Enable fcurve rna cache in the animation system and dependency graph

Jeroen Bakker (jbakker) retitled this revision from T77124: Research for remapping `RNA_path_resolve` to other ID Blocks to T77124: Remapping `RNA_path_resolve` to other ID Blocks for FCurves.Jul 9 2020, 4:22 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jul 9 2020, 4:42 PM
source/blender/blenkernel/intern/anim_sys.c
576 ↗(On Diff #25535)

No, it would add another branch that isn't needed.

source/blender/makesrna/intern/rna_access_cache.c
70

Use debug log

Sybren A. Stüvel (sybren) requested changes to this revision.Nov 1 2021, 5:10 PM

The patch description reads:

There are still some clean ups to do before this patch will be send for review.

but its status is "needs review".

Phabricator being what it is, I can't set it to "draft" or "planned changes" or anything, so I'll just set it to "request changes" so it's no longer listed as "needs review".

This revision now requires changes to proceed.Nov 1 2021, 5:10 PM