From e8962f90de4222d6f750d3d3478eff65490365d8 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 16 Oct 2017 16:36:44 -0200 Subject: Fix compatibility flag for nodetree NODE_NEWER_SHADING was introduced in e868b459bb8e however it should have been added as a bitflag. BKE_scene_uses_blender_eevee() was used in gpu_shader_output() as a workaround for compatibility being poorly used. Anyways this fixes this situation. This is necessary for an upcoming patch, even though this is considered temporary - since the other NODE_*_SHADING values are legacy from Blender Internal drawing. --- source/blender/blenkernel/BKE_node.h | 6 +++--- source/blender/gpu/intern/gpu_material.c | 2 +- source/blender/nodes/shader/node_shader_tree.c | 2 +- source/blender/nodes/shader/nodes/node_shader_output.c | 4 ---- 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index ea0b350b8af..3bb8f6c9ed3 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -251,9 +251,9 @@ typedef struct bNodeType { #define NODE_CLASS_LAYOUT 100 /* nodetype->compatibility */ -#define NODE_OLD_SHADING 1 -#define NODE_NEW_SHADING 2 -#define NODE_NEWER_SHADING 3 +#define NODE_OLD_SHADING (1 << 0) +#define NODE_NEW_SHADING (1 << 1) +#define NODE_NEWER_SHADING (1 << 2) /* node resize directions */ #define NODE_RESIZE_TOP 1 diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index a08bef4472a..ef37d6bd02a 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -2154,7 +2154,7 @@ GPUMaterial *GPU_material_from_nodetree( mat->engine_type = engine_type; mat->options = options; - ntreeGPUMaterialNodes(ntree, mat, NODE_NEWER_SHADING); + ntreeGPUMaterialNodes(ntree, mat, NODE_NEW_SHADING | NODE_NEWER_SHADING); /* Let Draw manager finish the construction. */ if (mat->outlink) { diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index 35a8c712905..08205d589bf 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -504,7 +504,7 @@ static bool ntree_tag_ssr_bsdf_cb(bNode *fromnode, bNode *UNUSED(tonode), void * */ static void ntree_shader_tag_ssr_node(bNodeTree *ntree, short compatibility) { - if (compatibility != NODE_NEWER_SHADING) { + if (compatibility & NODE_NEWER_SHADING) { /* We can only deal with new shading system here. */ return; } diff --git a/source/blender/nodes/shader/nodes/node_shader_output.c b/source/blender/nodes/shader/nodes/node_shader_output.c index dcf6fec41a4..52f659d8321 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output.c +++ b/source/blender/nodes/shader/nodes/node_shader_output.c @@ -76,10 +76,6 @@ static int gpu_shader_output(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSE GPU_material_enable_alpha(mat); #endif - if (BKE_scene_uses_blender_eevee(GPU_material_scene(mat))) { - return false; - } - GPU_stack_link(mat, node, "output_node", in, out, &outlink); GPU_material_output_link(mat, outlink); -- cgit v1.2.3