[Bf-blender-cvs] [15684cd] object_nodes: Use the BVM postfix to distinguish 'Function' in bvm backend from future LLVM functions.
Lukas Tönne
noreply at git.blender.org
Mon Apr 4 17:35:16 CEST 2016
Commit: 15684cda57b54e05c0002608bb1796272cd22b6a
Author: Lukas Tönne
Date: Thu Mar 31 16:24:40 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB15684cda57b54e05c0002608bb1796272cd22b6a
Use the BVM postfix to distinguish 'Function' in bvm backend from future LLVM functions.
===================================================================
M source/blender/blenkernel/BKE_effect.h
M source/blender/blenkernel/intern/DerivedMesh.c
M source/blender/blenkernel/intern/depsgraph.c
M source/blender/blenkernel/intern/effect.c
M source/blender/blenkernel/intern/object_dupli.c
M source/blender/blenkernel/intern/texture.c
M source/blender/blenvm/BVM_api.h
M source/blender/blenvm/compile/bvm_codegen.cc
M source/blender/blenvm/compile/bvm_codegen.h
M source/blender/blenvm/compile/bvm_function.cc
M source/blender/blenvm/compile/bvm_function.h
M source/blender/blenvm/intern/bvm_api.cc
M source/blender/blenvm/intern/function_cache.cc
M source/blender/blenvm/intern/function_cache.h
M source/blender/depsgraph/intern/depsgraph_build_nodes.cc
M source/blender/render/intern/source/render_texture.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 5c0100f..2a632d4 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -105,7 +105,7 @@ typedef struct EffectorCache {
float guide_loc[4], guide_dir[3], guide_radius;
float velocity[3];
- struct BVMFunction *function;
+ struct BVMFunctionBVM *function;
float frame;
int flag;
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 1cae7a4..e5c7394 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1701,10 +1701,10 @@ static DerivedMesh *mesh_calc_modifier_nodes(Scene *UNUSED(scene), Object *ob, b
Mesh *me = ob->data;
DerivedMesh *dm, *result;
- struct BVMFunction *fn = BVM_function_cache_acquire(ntree);
+ struct BVMFunctionBVM *fn = BVM_function_bvm_cache_acquire(ntree);
if (!fn) {
fn = BVM_gen_modifier_function(ntree);
- BVM_function_cache_set(ntree, fn);
+ BVM_function_bvm_cache_set(ntree, fn);
}
{
@@ -1718,7 +1718,7 @@ static DerivedMesh *mesh_calc_modifier_nodes(Scene *UNUSED(scene), Object *ob, b
BVM_globals_free(globals);
}
- BVM_function_release(fn);
+ BVM_function_bvm_cache_release(fn);
/* XXX this is stupid, but currently required because of
* the unreliability of dm->needsFree ...
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 3a9af97..aaed17f 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2672,7 +2672,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
if (ELEM(idtype, ID_TE)) {
Tex *tex = (Tex *)id;
- BVM_function_cache_remove(tex->nodetree);
+ BVM_function_bvm_cache_remove(tex->nodetree);
}
if (idtype == ID_MC) {
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 2484ff8..7e36e18 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -286,7 +286,7 @@ void pdEndEffectors(EffectorContext *effctx)
if (eff->guide_data)
MEM_freeN(eff->guide_data);
if (eff->function)
- BVM_function_free(eff->function);
+ BVM_function_bvm_free(eff->function);
}
BLI_freelistN(&effctx->effectors);
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index c7fc89a..6fd6ab4 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -1153,10 +1153,10 @@ const DupliGenerator gen_dupli_particles = {
static void make_duplis_nodetree(struct bNodeTree *ntree, const DupliContext *dupctx)
{
- struct BVMFunction *fn = BVM_function_cache_acquire(ntree);
+ struct BVMFunctionBVM *fn = BVM_function_bvm_cache_acquire(ntree);
if (!fn) {
fn = BVM_gen_dupli_function(ntree);
- BVM_function_cache_set(ntree, fn);
+ BVM_function_bvm_cache_set(ntree, fn);
}
{
@@ -1170,7 +1170,7 @@ static void make_duplis_nodetree(struct bNodeTree *ntree, const DupliContext *du
BVM_globals_free(globals);
}
- BVM_function_release(fn);
+ BVM_function_bvm_cache_release(fn);
}
static void make_duplis_nodes(const DupliContext *ctx)
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 273f5d3..ff2db97 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -1689,6 +1689,6 @@ void BKE_texture_get_value(
void BKE_texture_invalidate(EvaluationContext *UNUSED(eval_ctx), Tex *tex)
{
- BVM_function_cache_remove(tex->nodetree);
+ BVM_function_bvm_cache_remove(tex->nodetree);
}
diff --git a/source/blender/blenvm/BVM_api.h b/source/blender/blenvm/BVM_api.h
index 5d3700e..ef16658 100644
--- a/source/blender/blenvm/BVM_api.h
+++ b/source/blender/blenvm/BVM_api.h
@@ -116,13 +116,13 @@ typedef enum BVMDebugMode {
/* ------------------------------------------------------------------------- */
-void BVM_function_free(struct BVMFunctionBVM *fn);
+void BVM_function_bvm_free(struct BVMFunctionBVM *fn);
-struct BVMFunctionBVM *BVM_function_cache_acquire(void *key);
-void BVM_function_release(struct BVMFunctionBVM *_fn);
-void BVM_function_cache_set(void *key, struct BVMFunctionBVM *_fn);
-void BVM_function_cache_remove(void *key);
-void BVM_function_cache_clear(void);
+struct BVMFunctionBVM *BVM_function_bvm_cache_acquire(void *key);
+void BVM_function_bvm_cache_release(struct BVMFunctionBVM *_fn);
+void BVM_function_bvm_cache_set(void *key, struct BVMFunctionBVM *_fn);
+void BVM_function_bvm_cache_remove(void *key);
+void BVM_function_bvm_cache_clear(void);
/* ------------------------------------------------------------------------- */
diff --git a/source/blender/blenvm/compile/bvm_codegen.cc b/source/blender/blenvm/compile/bvm_codegen.cc
index 07c98c9..230ef56 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -622,11 +622,11 @@ int BVMCompiler::current_address() const
return fn->get_instruction_count();
}
-Function *BVMCompiler::compile_function(const NodeGraph &graph)
+FunctionBVM *BVMCompiler::compile_function(const NodeGraph &graph)
{
resolve_symbols(graph);
- fn = new Function();
+ fn = new FunctionBVM();
int entry_point = codegen_graph(graph);
fn->set_entry_point(entry_point);
@@ -655,7 +655,7 @@ Function *BVMCompiler::compile_function(const NodeGraph &graph)
fn->add_return_value(output.typedesc, output.name, stack_index);
}
- Function *result = fn;
+ FunctionBVM *result = fn;
fn = NULL;
return result;
}
diff --git a/source/blender/blenvm/compile/bvm_codegen.h b/source/blender/blenvm/compile/bvm_codegen.h
index 5fe224b..8438a61 100644
--- a/source/blender/blenvm/compile/bvm_codegen.h
+++ b/source/blender/blenvm/compile/bvm_codegen.h
@@ -46,7 +46,7 @@
namespace blenvm {
-struct Function;
+struct FunctionBVM;
struct NodeGraph;
struct NodeInstance;
struct TypeDesc;
@@ -114,7 +114,7 @@ struct BVMCompiler : public Compiler {
BVMCompiler();
~BVMCompiler();
- Function *compile_function(const NodeGraph &graph);
+ FunctionBVM *compile_function(const NodeGraph &graph);
protected:
void push_opcode(OpCode op) const;
@@ -131,7 +131,7 @@ protected:
int current_address() const;
private:
- Function *fn;
+ FunctionBVM *fn;
};
struct DebugGraphvizCompiler : public Compiler {
diff --git a/source/blender/blenvm/compile/bvm_function.cc b/source/blender/blenvm/compile/bvm_function.cc
index 62693a6..68dc240 100644
--- a/source/blender/blenvm/compile/bvm_function.cc
+++ b/source/blender/blenvm/compile/bvm_function.cc
@@ -34,19 +34,19 @@
namespace blenvm {
-mutex Function::users_mutex = mutex();
-spin_lock Function::users_lock = spin_lock(Function::users_mutex);
+mutex FunctionBVM::users_mutex = mutex();
+spin_lock FunctionBVM::users_lock = spin_lock(FunctionBVM::users_mutex);
-Function::Function() :
+FunctionBVM::FunctionBVM() :
m_users(0)
{
}
-Function::~Function()
+FunctionBVM::~FunctionBVM()
{
}
-void Function::retain(Function *fn)
+void FunctionBVM::retain(FunctionBVM *fn)
{
if (fn) {
users_lock.lock();
@@ -55,7 +55,7 @@ void Function::retain(Function *fn)
}
}
-void Function::release(Function **fn)
+void FunctionBVM::release(FunctionBVM **fn)
{
if (*fn) {
users_lock.lock();
@@ -69,17 +69,17 @@ void Function::release(Function **fn)
}
}
-size_t Function::num_arguments() const
+size_t FunctionBVM::num_arguments() const
{
return m_arguments.size();
}
-const Argument &Function::argument(size_t index) const
+const Argument &FunctionBVM::argument(size_t index) const
{
return m_arguments[index];
}
-const Argument &Function::argument(const string &name) const
+const Argument &FunctionBVM::argument(const string &name) const
{
for (ArgumentList::const_iterator it = m_arguments.begin(); it != m_arguments.end(); ++it)
if ((*it).name == name)
@@ -87,17 +87,17 @@ const Argument &Function::argument(const string &name) const
return *(m_arguments.end());
}
-size_t Function::num_return_values() const
+size_t FunctionBVM::num_return_values() const
{
return m_return_values.size();
}
-const Argument &Function::return_value(size_t index) const
+const Argument &FunctionBVM::return_value(size_t index) const
{
return m_return_values[index];
}
-const Argument &Function::return_value(const string &name) const
+const Argument &FunctionBVM::return_value(const string &name) const
{
for (ArgumentList::const_iterator it = m_return_values.begin(); it != m_return_values.end(); ++it)
if ((*it).name == name)
@@ -105,17 +105,17 @@ const Argument &Function::return_value(const string &name) const
return *(m_return_values.end());
}
-void Function::add_argument(const TypeDesc &typedesc, const string &name, StackIndex stack_offset)
+void FunctionBVM::add_argument(const TypeDesc &typedesc, const string &name, StackIndex stack_offset)
{
m_arguments.push_back(Argument(typedesc, name, stack_offset));
}
-void Function::add_return_value(const TypeDesc &typedesc, const string &name, StackIndex stack_offset)
+void FunctionBVM::add_return_value(const TypeDesc &typedesc, const string &name, StackIndex stack_offset)
{
m_return_values.push_back(Argument(typedesc, name, stack_offset));
}
-void Function::eval(EvalContext *context, const EvalGlobals *globals, const void *arguments[], void *results[]) const
+void FunctionBVM::eval(EvalContext *context, const EvalGlobals *globals, const void *arguments[], void *results[]) const
{
EvalStack stack[BVM_STACK_SIZE] = {0};
diff --git a/source/blender/blenvm/compile/bvm_function.h b/source/blender/blenvm/compile/bvm_function.h
index bf196da..8b3259d 100644
--- a/source/blender/blenvm/compile/bvm_function.h
+++ b/source/blender/blenvm/compile/bvm_function.h
@@ -64,14 +64,14 @@ struct Argument {
MEM_CXX_CLASS_ALLOC_FUNCS("BVM:ReturnValue")
};
-struct Function : public InstructionList {
+struct FunctionBVM : public InstructionList {
typedef std:
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list