Merge branch 'master' into blender2.8

This commit is contained in:
Sergey Sharybin 2018-02-21 10:51:58 +01:00
commit d4ee0cee51
21 changed files with 52 additions and 29 deletions

View File

@ -122,13 +122,16 @@ enum {
G_DEBUG_WM = (1 << 5), /* operator, undo */
G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
G_DEBUG_DEPSGRAPH = (1 << 8), /* depsgraph messages */
G_DEBUG_SIMDATA = (1 << 9), /* sim debug data display */
G_DEBUG_GPU_MEM = (1 << 10), /* gpu memory in status bar */
G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 11), /* single threaded depsgraph */
G_DEBUG_GPU = (1 << 12), /* gpu debug */
G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_EVAL | G_DEBUG_DEPSGRAPH_TAG),
G_DEBUG_SIMDATA = (1 << 12), /* sim debug data display */
G_DEBUG_GPU_MEM = (1 << 13), /* gpu memory in status bar */
G_DEBUG_GPU = (1 << 14), /* gpu debug */
G_DEBUG_IO = (1 << 13), /* IO Debugging (for Collada, ...)*/
G_DEBUG_GPU_SHADERS = (1 << 14), /* GLSL shaders */
G_DEBUG_GPU_SHADERS = (1 << 15), /* GLSL shaders */
};
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \

View File

@ -2879,7 +2879,7 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
/* ************** */
/* Evaluation API */
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
void BKE_animsys_eval_animdata(const EvaluationContext *eval_ctx, ID *id)
{

View File

@ -50,7 +50,7 @@
#include "BKE_global.h"
#include "BKE_main.h"
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
/* ********************** SPLINE IK SOLVER ******************* */

View File

@ -5258,7 +5258,7 @@ void BKE_curve_rect_from_textbox(const struct Curve *cu, const struct TextBox *t
void BKE_curve_eval_geometry(const EvaluationContext *UNUSED(eval_ctx),
Curve *curve)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s\n", __func__, curve->id.name);
}
if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) {

View File

@ -55,7 +55,7 @@
#include "BKE_object.h"
#include "BKE_scene.h"
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
/** Free (or release) any data used by this group (does not free the group itself). */
void BKE_group_free(Group *group)

View File

@ -57,7 +57,7 @@
#include "MEM_guardedalloc.h"
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
/* prototype */
struct EngineSettingsCB_Type;

View File

@ -898,7 +898,7 @@ void BKE_mask_layer_evaluate_deform(MaskLayer *masklay, const float ctime)
}
}
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
void BKE_mask_eval_animation(struct EvaluationContext *eval_ctx, Mask *mask)
{

View File

@ -1772,7 +1772,7 @@ bool BKE_object_material_edit_image_set(Object *ob, short mat_nr, Image *image)
void BKE_material_eval(const struct EvaluationContext *UNUSED(eval_ctx), Material *material)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s (%p)\n", __func__, material->id.name, material);
}
if ((BLI_listbase_is_empty(&material->gpumaterial) == false)) {

View File

@ -2667,7 +2667,7 @@ Mesh *BKE_mesh_new_from_object(
void BKE_mesh_eval_geometry(const EvaluationContext *UNUSED(eval_ctx),
Mesh *mesh)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s\n", __func__, mesh->id.name);
}
if (mesh->bb == NULL || (mesh->bb->flag & BOUNDBOX_DIRTY)) {

View File

@ -77,7 +77,7 @@
# include "intern/openexr/openexr_multi.h"
#endif
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
/*********************** movieclip buffer loaders *************************/

View File

@ -3870,7 +3870,7 @@ void BKE_nodetree_shading_params_eval(const struct EvaluationContext *UNUSED(eva
bNodeTree *ntree_dst,
const bNodeTree *ntree_src)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s (%p)\n", __func__, ntree_src->id.name, ntree_dst);
}
BKE_nodetree_copy_default_values(ntree_dst, ntree_src);

View File

@ -2770,7 +2770,7 @@ void BKE_object_handle_update_ex(const EvaluationContext *eval_ctx,
* which is only in BKE_object_where_is_calc now */
/* XXX: should this case be OB_RECALC_OB instead? */
if (recalc_object || recalc_data) {
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("recalcob %s\n", ob->id.name + 2);
}
/* Handle proxy copy for target. */

View File

@ -65,7 +65,7 @@
#include "MEM_guardedalloc.h"
#include "DEG_depsgraph.h"
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
void BKE_object_eval_local_transform(const EvaluationContext *UNUSED(eval_ctx),
Object *ob)
@ -152,7 +152,7 @@ void BKE_object_handle_data_update(
Key *key;
float ctime = BKE_scene_frame_get(scene);
if (G.debug & G_DEBUG_DEPSGRAPH)
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL)
printf("recalcdata %s\n", ob->id.name + 2);
/* TODO(sergey): Only used by legacy depsgraph. */

View File

@ -4419,7 +4419,7 @@ void BKE_particlesystem_id_loop(ParticleSystem *psys, ParticleSystemIDFunc func,
void BKE_particle_system_settings_eval(const struct EvaluationContext *UNUSED(eval_ctx),
ParticleSystem *psys)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s (%p)\n", __func__, psys->name, psys);
}
psys->recalc |= psys->part->recalc;
@ -4428,7 +4428,7 @@ void BKE_particle_system_settings_eval(const struct EvaluationContext *UNUSED(ev
void BKE_particle_system_settings_recalc_clear(struct EvaluationContext *UNUSED(eval_ctx),
ParticleSettings *particle_settings)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s (%p)\n", __func__, particle_settings->id.name, particle_settings);
}
particle_settings->recalc = 0;
@ -4438,7 +4438,7 @@ void BKE_particle_system_eval_init(const struct EvaluationContext *UNUSED(eval_c
Scene *scene,
Object *ob)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s (%p)\n", __func__, ob->id.name, ob);
}
BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH);

View File

@ -1689,7 +1689,7 @@ void BKE_rigidbody_rebuild_sim(const struct EvaluationContext *eval_ctx,
{
float ctime = BKE_scene_frame_get(scene);
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s at %f\n", __func__, ctime);
}
@ -1704,7 +1704,7 @@ void BKE_rigidbody_eval_simulation(const struct EvaluationContext *eval_ctx,
{
float ctime = BKE_scene_frame_get(scene);
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s at %f\n", __func__, ctime);
}
@ -1721,7 +1721,7 @@ void BKE_rigidbody_object_sync_transforms(const struct EvaluationContext *UNUSED
RigidBodyWorld *rbw = scene->rigidbody_world;
float ctime = BKE_scene_frame_get(scene);
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s\n", __func__, ob->id.name);
}

View File

@ -196,7 +196,7 @@ void BKE_world_make_local(Main *bmain, World *wrld, const bool lib_local)
void BKE_world_eval(const struct EvaluationContext *UNUSED(eval_ctx), World *world)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("%s on %s (%p)\n", __func__, world->id.name, world);
}
if (!BLI_listbase_is_empty(&world->gpumaterial)) {

View File

@ -114,7 +114,7 @@ void deg_editors_scene_update(const DEGEditorUpdateContext *update_ctx,
#define DEG_DEBUG_PRINTF(...) \
do { \
if (G.debug & G_DEBUG_DEPSGRAPH) { \
if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) { \
fprintf(stderr, __VA_ARGS__); \
fflush(stderr); \
} \

View File

@ -508,7 +508,9 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, int flag)
/* Ideally should not happen, but old depsgraph allowed this. */
return;
}
DEG_DEBUG_PRINTF("%s: id=%s flag=%d\n", __func__, id->name, flag);
if (G.debug & G_DEBUG_DEPSGRAPH_TAG) {
printf("%s: id=%s flag=%d\n", __func__, id->name, flag);
}
DEG::deg_id_tag_update(bmain, id, flag);
}

View File

@ -87,7 +87,7 @@ extern "C" {
namespace DEG {
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
namespace {

View File

@ -357,6 +357,9 @@ static PyGetSetDef bpy_app_getsets[] = {
{(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS},
{(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
{(char *)"debug_depsgraph", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH},
{(char *)"debug_depsgraph_build", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH_BUILD},
{(char *)"debug_depsgraph_eval", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH_EVAL},
{(char *)"debug_depsgraph_tag", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH_TAG},
{(char *)"debug_simdata", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_SIMDATA},
{(char *)"debug_gpumem", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_GPU_MEM},

View File

@ -570,6 +570,9 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
BLI_argsPrintArgDoc(ba, "--debug-jobs");
BLI_argsPrintArgDoc(ba, "--debug-python");
BLI_argsPrintArgDoc(ba, "--debug-depsgraph");
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-eval");
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-build");
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-tag");
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-no-threads");
BLI_argsPrintArgDoc(ba, "--debug-gpumem");
@ -765,7 +768,13 @@ static const char arg_handle_debug_mode_generic_set_doc_jobs[] =
static const char arg_handle_debug_mode_generic_set_doc_gpu[] =
"\n\tEnable gpu debug context and information for OpenGL 4.3+.";
static const char arg_handle_debug_mode_generic_set_doc_depsgraph[] =
"\n\tEnable debug messages from dependency graph.";
"\n\tEnable all debug messages from dependency graph.";
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_build[] =
"\n\tEnable debug messages from dependency graph related on graph construction.";
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_tag[] =
"\n\tEnable debug messages from dependency graph related on tagging.";
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_eval[] =
"\n\tEnable debug messages from dependency graph related on evaluation.";
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_no_threads[] =
"\n\tSwitch dependency graph to a single threaded evaluation.";
static const char arg_handle_debug_mode_generic_set_doc_gpumem[] =
@ -1855,6 +1864,12 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
CB_EX(arg_handle_debug_mode_generic_set, gpu), (void *)G_DEBUG_GPU);
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph",
CB_EX(arg_handle_debug_mode_generic_set, depsgraph), (void *)G_DEBUG_DEPSGRAPH);
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-build",
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_build), (void *)G_DEBUG_DEPSGRAPH_BUILD);
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-eval",
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_eval), (void *)G_DEBUG_DEPSGRAPH_EVAL);
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-tag",
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_tag), (void *)G_DEBUG_DEPSGRAPH_TAG);
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-no-threads",
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_no_threads), (void *)G_DEBUG_DEPSGRAPH_NO_THREADS);
BLI_argsAdd(ba, 1, NULL, "--debug-gpumem",