Blender  V3.3
deg_eval_copy_on_write.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2017 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include <stddef.h>
11 
12 #include "DNA_ID.h"
13 
14 struct ID;
15 
16 /* Uncomment this to have verbose log about original and CoW pointers
17  * logged, with detailed information when they are allocated, expanded
18  * and remapped.
19  */
20 // #define DEG_DEBUG_COW_POINTERS
21 
22 #ifdef DEG_DEBUG_COW_POINTERS
23 # define DEG_COW_PRINT(format, ...) printf(format, __VA_ARGS__);
24 #else
25 # define DEG_COW_PRINT(format, ...)
26 #endif
27 
28 struct Depsgraph;
29 
30 namespace blender::deg {
31 
32 struct Depsgraph;
33 class DepsgraphNodeBuilder;
34 struct IDNode;
35 
41 ID *deg_update_copy_on_write_datablock(const struct Depsgraph *depsgraph, struct ID *id_orig);
42 
44 void deg_free_copy_on_write_datablock(struct ID *id_cow);
45 
51 
57 
59 void deg_tag_copy_on_write_id(struct ID *id_cow, const struct ID *id_orig);
60 
66 bool deg_copy_on_write_is_expanded(const struct ID *id_cow);
67 
76 bool deg_copy_on_write_is_needed(const ID *id_orig);
77 bool deg_copy_on_write_is_needed(const ID_Type id_type);
78 
79 } // namespace blender::deg
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
ID and Library types, which are fundamental for sdna.
ID_Type
Definition: DNA_ID_enums.h:44
const IDNode * id_node
const Depsgraph * depsgraph
ID * deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode *id_node)
bool deg_copy_on_write_is_needed(const ID *id_orig)
void deg_tag_copy_on_write_id(ID *id_cow, const ID *id_orig)
bool deg_validate_copy_on_write_datablock(ID *id_cow)
bool deg_copy_on_write_is_expanded(const ID *id_cow)
void deg_evaluate_copy_on_write(struct ::Depsgraph *graph, const IDNode *id_node)
void deg_free_copy_on_write_datablock(ID *id_cow)
Definition: DNA_ID.h:368