diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-11-28 19:22:15 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-11-28 19:22:37 +0300 |
commit | e559a99a04131ac0e5edea063d955128815627b8 (patch) | |
tree | 967bba4585c62555e3505d126f9074973b96a65e /source | |
parent | 701ebb0a64c67ab6190b8c02040e8de25e47ed8c (diff) |
Eevee: Fix T53413: Crash when using displacement bump relink.
ntree_shader_relink_displacement is creating a transient node that does not have a correct original to point to.
In this case we revert to constant uniform.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index bc91df895c8..9e4daa2a036 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1589,6 +1589,15 @@ static GPUNodeLink *gpu_uniformbuffer_link( GPUMaterial *mat, bNode *node, GPUNodeStack *stack, const int index, const eNodeSocketInOut in_out) { bNodeSocket *socket; + + /* Some nodes can have been create on the fly and does + * not have an original to point to. (i.e. the bump from + * ntree_shader_relink_displacement). In this case just + * revert to static constant folding. */ + if (node->original == NULL) { + return NULL; + } + if (in_out == SOCK_IN) { socket = BLI_findlink(&node->original->inputs, index); } |