Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-07-20 17:13:08 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-07-20 18:48:36 +0300
commitdfcb568c165913a15679f6b55b0b76e49a747a2e (patch)
tree548a0e39e6e22020be213a7fa6311e0d5f3d1901 /source/blender/blenkernel
parent177a8f6dab191db2756cc247565458b07d5b6005 (diff)
Fix T51925: Eevee: Animated Eevee values slowdown
Move material update from RNA callback to dependency graph.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_material.h6
-rw-r--r--source/blender/blenkernel/BKE_world.h6
-rw-r--r--source/blender/blenkernel/intern/material.c10
-rw-r--r--source/blender/blenkernel/intern/world.c11
4 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 85c649bbd3d..14820587200 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -118,6 +118,12 @@ void free_matcopybuf(void);
void copy_matcopybuf(struct Material *ma);
void paste_matcopybuf(struct Material *ma);
+/* Evaluation. */
+
+struct EvaluationContext;
+
+void BKE_material_eval(struct EvaluationContext *eval_ctx, struct Material *material);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h
index 18ae61f7653..5175edcd3d6 100644
--- a/source/blender/blenkernel/BKE_world.h
+++ b/source/blender/blenkernel/BKE_world.h
@@ -43,5 +43,11 @@ struct World *BKE_world_copy(struct Main *bmain, const struct World *wrld);
struct World *localize_world(struct World *wrld);
void BKE_world_make_local(struct Main *bmain, struct World *wrld, const bool lib_local);
+/* Evaluation. */
+
+struct EvaluationContext;
+
+void BKE_world_eval(struct EvaluationContext *eval_ctx, struct World *world);
+
#endif
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index e7232322a36..7038fb0ddcf 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1797,3 +1797,13 @@ bool BKE_object_material_edit_image_set(Object *ob, short mat_nr, Image *image)
}
return false;
}
+
+void BKE_material_eval(struct EvaluationContext *UNUSED(eval_ctx), Material *material)
+{
+ if (G.debug & G_DEBUG_DEPSGRAPH) {
+ printf("%s on %s (%p)\n", __func__, material->id.name, material);
+ }
+ if ((BLI_listbase_is_empty(&material->gpumaterial) == false)) {
+ GPU_material_uniform_buffer_tag_dirty(&material->gpumaterial);
+ }
+}
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 363c36e644d..2adbdc83a36 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -175,3 +175,14 @@ void BKE_world_make_local(Main *bmain, World *wrld, const bool lib_local)
{
BKE_id_make_local_generic(bmain, &wrld->id, true, lib_local);
}
+
+void BKE_world_eval(struct EvaluationContext *UNUSED(eval_ctx), World *world)
+{
+ if (G.debug & G_DEBUG_DEPSGRAPH) {
+ printf("%s on %s (%p)\n", __func__, world->id.name, world);
+ }
+ if (!BLI_listbase_is_empty(&world->gpumaterial)) {
+ world->update_flag = 1;
+ GPU_material_uniform_buffer_tag_dirty(&world->gpumaterial);
+ }
+}