diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-08-01 20:25:58 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-08-01 23:08:36 +0300 |
commit | ad64cb63448d69ec1667bfa2e4941dfb996841dd (patch) | |
tree | 837354560da816a85fa4a4aa2602394eec7f0002 /source/blender/nodes/shader | |
parent | 4510f30026da8eb090062687f386b9e3a7cf3fa3 (diff) |
GPUMaterial: Make Localize tree live longer
This is in order to reference the localized node->storage when populating
the UBO data.
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r-- | source/blender/nodes/shader/node_shader_tree.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index 919af171756..6f2c7835a3c 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -583,10 +583,9 @@ static void ntree_shader_tag_sss_node(bNodeTree *ntree, bNode *output_node) nodeChainIter(ntree, output_node, ntree_tag_sss_bsdf_cb, &sss_id, true); } -void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat, bool *has_surface_output, bool *has_volume_output) +/* This one needs to work on a local tree. */ +void ntreeGPUMaterialNodes(bNodeTree *localtree, GPUMaterial *mat, bool *has_surface_output, bool *has_volume_output) { - /* localize tree to create links for reroute and mute */ - bNodeTree *localtree = ntreeLocalize(ntree); bNode *output = ntreeShaderOutputNode(localtree, SHD_OUTPUT_EEVEE); bNodeTreeExec *exec; @@ -618,9 +617,6 @@ void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat, bool *has_surface *has_volume_output = (nodeCountSocketLinks(localtree, volume_sock) > 0); } } - - ntreeFreeTree(localtree); - MEM_freeN(localtree); } bNodeTreeExec *ntreeShaderBeginExecTree_internal(bNodeExecContext *context, bNodeTree *ntree, bNodeInstanceKey parent_key) |