Fix T57689: world nodes / texture not updating for Eevee.
Only do GPU material updates through depsgraph evaluation now. This was already happening for material, just missing for the world.
This commit is contained in:
parent
d4370e2e00
commit
11a53ec28a
Notes:
blender-bot
2023-02-14 05:04:45 +01:00
Referenced by issue #57689, Latest blender 2.8 environment texture broken.
|
@ -33,6 +33,7 @@
|
|||
* \author nzc
|
||||
*/
|
||||
|
||||
struct Depsgraph;
|
||||
struct Main;
|
||||
struct World;
|
||||
|
||||
|
@ -43,5 +44,6 @@ void BKE_world_copy_data(struct Main *bmain, struct World *wrld_dst, const struc
|
|||
struct World *BKE_world_copy(struct Main *bmain, const struct World *wrld);
|
||||
struct World *BKE_world_localize(struct World *wrld);
|
||||
void BKE_world_make_local(struct Main *bmain, struct World *wrld, const bool lib_local);
|
||||
void BKE_world_eval(struct Depsgraph *depsgraph, struct World *world);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -168,3 +168,9 @@ 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 Depsgraph *depsgraph, World *world)
|
||||
{
|
||||
DEG_debug_print_eval(depsgraph, __func__, world->id.name, world);
|
||||
GPU_material_free(&world->gpumaterial);
|
||||
}
|
||||
|
|
|
@ -975,17 +975,20 @@ void DepsgraphNodeBuilder::build_world(World *world)
|
|||
if (built_map_.checkIsBuiltAndTag(world)) {
|
||||
return;
|
||||
}
|
||||
/* Animation. */
|
||||
build_animdata(&world->id);
|
||||
/* world itself */
|
||||
/* World itself. */
|
||||
add_id_node(&world->id);
|
||||
World *world_cow = get_cow_datablock(world);
|
||||
/* Shading update. */
|
||||
add_operation_node(&world->id,
|
||||
DEG_NODE_TYPE_SHADING,
|
||||
NULL,
|
||||
function_bind(BKE_world_eval,
|
||||
_1,
|
||||
world_cow),
|
||||
DEG_OPCODE_WORLD_UPDATE);
|
||||
/* world's nodetree */
|
||||
if (world->nodetree != NULL) {
|
||||
build_nodetree(world->nodetree);
|
||||
}
|
||||
/* Animation. */
|
||||
build_animdata(&world->id);
|
||||
/* World's nodetree. */
|
||||
build_nodetree(world->nodetree);
|
||||
}
|
||||
|
||||
/* Rigidbody Simulation - Scene Level */
|
||||
|
|
|
@ -1510,14 +1510,18 @@ void DepsgraphRelationBuilder::build_world(World *world)
|
|||
if (built_map_.checkIsBuiltAndTag(world)) {
|
||||
return;
|
||||
}
|
||||
/* animation */
|
||||
build_animdata(&world->id);
|
||||
/* TODO: other settings? */
|
||||
/* world's nodetree */
|
||||
if (world->nodetree != NULL) {
|
||||
build_nodetree(world->nodetree);
|
||||
ComponentKey ntree_key(&world->nodetree->id, DEG_NODE_TYPE_SHADING);
|
||||
ComponentKey world_key(&world->id, DEG_NODE_TYPE_SHADING);
|
||||
add_relation(ntree_key, world_key, "NTree->World Shading Update");
|
||||
OperationKey ntree_key(&world->nodetree->id,
|
||||
DEG_NODE_TYPE_SHADING,
|
||||
DEG_OPCODE_MATERIAL_UPDATE);
|
||||
OperationKey world_key(&world->id,
|
||||
DEG_NODE_TYPE_SHADING,
|
||||
DEG_OPCODE_MATERIAL_UPDATE);
|
||||
add_relation(ntree_key, world_key, "World's NTree");
|
||||
build_nested_nodetree(&world->id, world->nodetree);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -270,7 +270,9 @@ void flush_editors_id_update(Main *bmain,
|
|||
* TODO: image datablocks do not use COW, so might not be detected
|
||||
* correctly. */
|
||||
if (deg_copy_on_write_is_expanded(id_cow)) {
|
||||
deg_editors_id_update(update_ctx, id_orig);
|
||||
if (graph->is_active) {
|
||||
deg_editors_id_update(update_ctx, id_orig);
|
||||
}
|
||||
/* ID may need to get its auto-override operations refreshed. */
|
||||
if (ID_IS_STATIC_OVERRIDE_AUTO(id_orig)) {
|
||||
id_orig->tag |= LIB_TAG_OVERRIDESTATIC_AUTOREFRESH;
|
||||
|
|
|
@ -58,8 +58,6 @@
|
|||
#include "BKE_scene.h"
|
||||
#include "BKE_workspace.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
|
||||
#include "RE_engine.h"
|
||||
#include "RE_pipeline.h"
|
||||
|
||||
|
@ -73,8 +71,6 @@
|
|||
|
||||
#include "render_intern.h" // own include
|
||||
|
||||
extern Material defmaterial;
|
||||
|
||||
/***************************** Render Engines ********************************/
|
||||
|
||||
void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int updated)
|
||||
|
@ -244,22 +240,12 @@ static void material_changed(Main *UNUSED(bmain), Material *ma)
|
|||
{
|
||||
/* icons */
|
||||
BKE_icon_changed(BKE_icon_id_ensure(&ma->id));
|
||||
|
||||
/* glsl */
|
||||
if (ma->id.recalc & ID_RECALC) {
|
||||
if (!BLI_listbase_is_empty(&ma->gpumaterial)) {
|
||||
GPU_material_free(&ma->gpumaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void lamp_changed(Main *UNUSED(bmain), Lamp *la)
|
||||
{
|
||||
/* icons */
|
||||
BKE_icon_changed(BKE_icon_id_ensure(&la->id));
|
||||
|
||||
if (defmaterial.gpumaterial.first)
|
||||
GPU_material_free(&defmaterial.gpumaterial);
|
||||
}
|
||||
|
||||
static void texture_changed(Main *bmain, Tex *tex)
|
||||
|
@ -271,15 +257,12 @@ static void texture_changed(Main *bmain, Tex *tex)
|
|||
/* icons */
|
||||
BKE_icon_changed(BKE_icon_id_ensure(&tex->id));
|
||||
|
||||
/* paint overlays */
|
||||
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
|
||||
/* paint overlays */
|
||||
for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) {
|
||||
BKE_paint_invalidate_overlay_tex(scene, view_layer, tex);
|
||||
}
|
||||
}
|
||||
|
||||
/* find compositing nodes */
|
||||
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
|
||||
/* find compositing nodes */
|
||||
if (scene->use_nodes && scene->nodetree) {
|
||||
for (node = scene->nodetree->nodes.first; node; node = node->next) {
|
||||
if (node->id == &tex->id)
|
||||
|
@ -293,16 +276,6 @@ static void world_changed(Main *UNUSED(bmain), World *wo)
|
|||
{
|
||||
/* icons */
|
||||
BKE_icon_changed(BKE_icon_id_ensure(&wo->id));
|
||||
|
||||
/* glsl */
|
||||
if (wo->id.recalc & ID_RECALC) {
|
||||
if (!BLI_listbase_is_empty(&defmaterial.gpumaterial)) {
|
||||
GPU_material_free(&defmaterial.gpumaterial);
|
||||
}
|
||||
if (!BLI_listbase_is_empty(&wo->gpumaterial)) {
|
||||
GPU_material_free(&wo->gpumaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void image_changed(Main *bmain, Image *ima)
|
||||
|
|
|
@ -84,8 +84,6 @@
|
|||
# include "smoke_API.h"
|
||||
#endif
|
||||
|
||||
extern Material defmaterial; /* from material.c */
|
||||
|
||||
//* Checking powers of two for images since OpenGL ES requires it */
|
||||
#ifdef WITH_DDS
|
||||
static bool is_power_of_2_resolution(int w, int h)
|
||||
|
|
Loading…
Reference in New Issue