[Bf-blender-cvs] [a9cdbda] object_nodes: Partial revert: Use only BVMFunction stub type as a handle for all backends.
Lukas Tönne
noreply at git.blender.org
Mon Apr 4 17:35:18 CEST 2016
Commit: a9cdbda68796404d7fd33838114773a9f2c0f6be
Author: Lukas Tönne
Date: Thu Mar 31 16:39:21 2016 +0200
Branches: object_nodes
https://developer.blender.org/rBa9cdbda68796404d7fd33838114773a9f2c0f6be
Partial revert: Use only BVMFunction stub type as a handle for all backends.
API functions are still distinguished by backend.
===================================================================
M source/blender/blenkernel/BKE_effect.h
M source/blender/blenkernel/intern/DerivedMesh.c
M source/blender/blenkernel/intern/object_dupli.c
M source/blender/blenvm/BVM_api.h
M source/blender/blenvm/intern/bvm_api.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 2a632d4..5c0100f 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 BVMFunctionBVM *function;
+ struct BVMFunction *function;
float frame;
int flag;
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index e5c7394..183c888 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1701,7 +1701,7 @@ static DerivedMesh *mesh_calc_modifier_nodes(Scene *UNUSED(scene), Object *ob, b
Mesh *me = ob->data;
DerivedMesh *dm, *result;
- struct BVMFunctionBVM *fn = BVM_function_bvm_cache_acquire(ntree);
+ struct BVMFunction *fn = BVM_function_bvm_cache_acquire(ntree);
if (!fn) {
fn = BVM_gen_modifier_function(ntree);
BVM_function_bvm_cache_set(ntree, fn);
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 6fd6ab4..4953436 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -1153,7 +1153,7 @@ const DupliGenerator gen_dupli_particles = {
static void make_duplis_nodetree(struct bNodeTree *ntree, const DupliContext *dupctx)
{
- struct BVMFunctionBVM *fn = BVM_function_bvm_cache_acquire(ntree);
+ struct BVMFunction *fn = BVM_function_bvm_cache_acquire(ntree);
if (!fn) {
fn = BVM_gen_dupli_function(ntree);
BVM_function_bvm_cache_set(ntree, fn);
diff --git a/source/blender/blenvm/BVM_api.h b/source/blender/blenvm/BVM_api.h
index ef16658..24218a5 100644
--- a/source/blender/blenvm/BVM_api.h
+++ b/source/blender/blenvm/BVM_api.h
@@ -40,11 +40,10 @@
extern "C" {
#endif
-/* XXX Stupid naming, sorry ...
- * Rationale: BVM*** is short prefix for "BlenVM" (to be changed later?).
- * ***FunctionBVM means a function in the bvm backend implementation (see FunctionLLVM etc.)
+/* Generic handle for functions.
+ * Warning: This is used for all backends! Callers must know which backend to use!
*/
-struct BVMFunctionBVM;
+struct BVMFunction;
void BVM_init(void);
void BVM_free(void);
@@ -116,11 +115,11 @@ typedef enum BVMDebugMode {
/* ------------------------------------------------------------------------- */
-void BVM_function_bvm_free(struct BVMFunctionBVM *fn);
+void BVM_function_bvm_free(struct BVMFunction *fn);
-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);
+struct BVMFunction *BVM_function_bvm_cache_acquire(void *key);
+void BVM_function_bvm_cache_release(struct BVMFunction *_fn);
+void BVM_function_bvm_cache_set(void *key, struct BVMFunction *_fn);
void BVM_function_bvm_cache_remove(void *key);
void BVM_function_bvm_cache_clear(void);
@@ -129,10 +128,10 @@ void BVM_function_bvm_cache_clear(void);
struct Object;
struct EffectedPoint;
-struct BVMFunctionBVM *BVM_gen_forcefield_function(struct bNodeTree *btree);
+struct BVMFunction *BVM_gen_forcefield_function(struct bNodeTree *btree);
void BVM_debug_forcefield_nodes(struct bNodeTree *btree, FILE *debug_file, const char *label, BVMDebugMode mode);
-void BVM_eval_forcefield(struct BVMEvalGlobals *globals, struct BVMEvalContext *context, struct BVMFunctionBVM *fn,
+void BVM_eval_forcefield(struct BVMEvalGlobals *globals, struct BVMEvalContext *context, struct BVMFunction *fn,
struct Object *effob, const struct EffectedPoint *point, float force[3], float impulse[3]);
/* ------------------------------------------------------------------------- */
@@ -140,10 +139,10 @@ void BVM_eval_forcefield(struct BVMEvalGlobals *globals, struct BVMEvalContext *
struct Tex;
struct TexResult;
-struct BVMFunctionBVM *BVM_gen_texture_function(struct bNodeTree *btree);
+struct BVMFunction *BVM_gen_texture_function(struct bNodeTree *btree);
void BVM_debug_texture_nodes(struct bNodeTree *btree, FILE *debug_file, const char *label, BVMDebugMode mode);
-void BVM_eval_texture(struct BVMEvalContext *context, struct BVMFunctionBVM *fn,
+void BVM_eval_texture(struct BVMEvalContext *context, struct BVMFunction *fn,
struct TexResult *target,
float coord[3], float dxt[3], float dyt[3], int osatex,
short which_output, int cfra, int preview);
@@ -153,12 +152,12 @@ void BVM_eval_texture(struct BVMEvalContext *context, struct BVMFunctionBVM *fn,
struct DerivedMesh;
struct Mesh;
-struct BVMFunctionBVM *BVM_gen_modifier_function(struct bNodeTree *btree);
+struct BVMFunction *BVM_gen_modifier_function(struct bNodeTree *btree);
void BVM_debug_modifier_nodes(struct bNodeTree *btree, FILE *debug_file, const char *label, BVMDebugMode mode);
struct DerivedMesh *BVM_eval_modifier(struct BVMEvalGlobals *globals,
struct BVMEvalContext *context,
- struct BVMFunctionBVM *fn,
+ struct BVMFunction *fn,
struct Object *ob,
struct Mesh *base_mesh);
@@ -166,12 +165,12 @@ struct DerivedMesh *BVM_eval_modifier(struct BVMEvalGlobals *globals,
struct DupliContainer;
-struct BVMFunctionBVM *BVM_gen_dupli_function(struct bNodeTree *btree);
+struct BVMFunction *BVM_gen_dupli_function(struct bNodeTree *btree);
void BVM_debug_dupli_nodes(struct bNodeTree *btree, FILE *debug_file, const char *label, BVMDebugMode mode);
void BVM_eval_dupli(struct BVMEvalGlobals *globals,
struct BVMEvalContext *context,
- struct BVMFunctionBVM *fn,
+ struct BVMFunction *fn,
struct Object *object,
struct DupliContainer *duplicont);
diff --git a/source/blender/blenvm/intern/bvm_api.cc b/source/blender/blenvm/intern/bvm_api.cc
index 85be17e..f86f985 100644
--- a/source/blender/blenvm/intern/bvm_api.cc
+++ b/source/blender/blenvm/intern/bvm_api.cc
@@ -319,23 +319,23 @@ void BVM_context_free(struct BVMEvalContext *ctx)
/* ------------------------------------------------------------------------- */
-BLI_INLINE blenvm::FunctionBVM *_FUNC(struct BVMFunctionBVM *fn)
+BLI_INLINE blenvm::FunctionBVM *_FUNC(struct BVMFunction *fn)
{ return (blenvm::FunctionBVM *)fn; }
-void BVM_function_bvm_free(struct BVMFunctionBVM *fn)
+void BVM_function_bvm_free(struct BVMFunction *fn)
{ delete _FUNC(fn); }
-struct BVMFunctionBVM *BVM_function_bvm_cache_acquire(void *key)
+struct BVMFunction *BVM_function_bvm_cache_acquire(void *key)
{
- return (BVMFunctionBVM *)blenvm::function_bvm_cache_acquire(key);
+ return (BVMFunction *)blenvm::function_bvm_cache_acquire(key);
}
-void BVM_function_bvm_cache_release(BVMFunctionBVM *fn)
+void BVM_function_bvm_cache_release(BVMFunction *fn)
{
blenvm::function_bvm_cache_release(_FUNC(fn));
}
-void BVM_function_bvm_cache_set(void *key, BVMFunctionBVM *fn)
+void BVM_function_bvm_cache_set(void *key, BVMFunction *fn)
{
blenvm::function_bvm_cache_set(key, _FUNC(fn));
}
@@ -384,7 +384,7 @@ static void init_forcefield_graph(blenvm::NodeGraph &graph)
graph.add_output("impulse", "FLOAT3", zero);
}
-struct BVMFunctionBVM *BVM_gen_forcefield_function(bNodeTree *btree)
+struct BVMFunction *BVM_gen_forcefield_function(bNodeTree *btree)
{
using namespace blenvm;
@@ -397,7 +397,7 @@ struct BVMFunctionBVM *BVM_gen_forcefield_function(bNodeTree *btree)
FunctionBVM *fn = compiler.compile_function(graph);
FunctionBVM::retain(fn);
- return (BVMFunctionBVM *)fn;
+ return (BVMFunction *)fn;
}
void BVM_debug_forcefield_nodes(bNodeTree *btree, FILE *debug_file, const char *label, BVMDebugMode mode)
@@ -425,7 +425,7 @@ void BVM_debug_forcefield_nodes(bNodeTree *btree, FILE *debug_file, const char *
}
}
-void BVM_eval_forcefield(struct BVMEvalGlobals *globals, struct BVMEvalContext *ctx, struct BVMFunctionBVM *fn,
+void BVM_eval_forcefield(struct BVMEvalGlobals *globals, struct BVMEvalContext *ctx, struct BVMFunction *fn,
struct Object *effob, const EffectedPoint *point, float force[3], float impulse[3])
{
using namespace blenvm;
@@ -924,7 +924,7 @@ static void init_texture_graph(blenvm::NodeGraph &graph)
graph.add_output("normal", "FLOAT3", N);
}
-struct BVMFunctionBVM *BVM_gen_texture_function(bNodeTree *btree)
+struct BVMFunction *BVM_gen_texture_function(bNodeTree *btree)
{
using namespace blenvm;
@@ -937,7 +937,7 @@ struct BVMFunctionBVM *BVM_gen_texture_function(bNodeTree *btree)
FunctionBVM *fn = compiler.compile_function(graph);
FunctionBVM::retain(fn);
- return (BVMFunctionBVM *)fn;
+ return (BVMFunction *)fn;
}
void BVM_debug_texture_nodes(bNodeTree *btree, FILE *debug_file, const char *label, BVMDebugMode mode)
@@ -965,7 +965,7 @@ void BVM_debug_texture_nodes(bNodeTree *btree, FILE *debug_file, const char *lab
}
}
-void BVM_eval_texture(struct BVMEvalContext *ctx, struct BVMFunctionBVM *fn,
+void BVM_eval_texture(struct BVMEvalContext *ctx, struct BVMFunction *fn,
struct TexResult *target,
float coord[3], float dxt[3], float dyt[3], int osatex,
short which_output, int cfra, int UNUSED(preview))
@@ -1007,7 +1007,7 @@ static void init_modifier_graph(blenvm::NodeGraph &graph)
graph.add_output("mesh", "MESH", __empty_mesh__);
}
-struct BVMFunctionBVM *BVM_gen_modifier_function(struct bNodeTree *btree)
+struct BVMFunction *BVM_gen_modifier_function(struct bNodeTree *btree)
{
using namespace blenvm;
@@ -1020,7 +1020,7 @@ struct BVMFunctionBVM *BVM_gen_modifier_function(struct bNodeTree *btree)
FunctionBVM *fn = compiler.compile_function(graph);
FunctionBVM::retain(fn);
- return (BVMFunctionBVM *)fn;
+ return (BVMFunction *)fn;
}
void BVM_debug_modifier_nodes(struct bNo
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list