Cycles: Ensure order of shader nodes in the dependnecies set
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 25 Nov 2015 08:07:29 +0000 (13:07 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 25 Nov 2015 08:07:32 +0000 (13:07 +0500)
commit443b159f023a872472d8e61c7270dab472a3d8ee
tree011015dbde30f6adc8b95c2710e2e5a5f13ca528
parentde35827612f85511aed50b9f05953ad857fe7e1c
Cycles: Ensure order of shader nodes in the dependnecies set

The issue was than nodes dependencies were stored as set<ShaderNode*> which
is actually a so called "strict weak ordered", meaning order of nodes in
the set is strictly defined, but based on the ShaderNode pointer. This means
that between different render invokations order of original nodes could be
different due to different pointers allocated for ShaderNode.

This commit makes it so dependencies and maps used for ShaderNodes are based
on the node->id which has much more predictable order. It's still possible
to trick the system by doing some crazy edits during viewport rendfer and
cause difference between viewport and final render stacks.

Reviewers: brecht

Reviewed By: brecht

Subscribers: LazyDodo

Differential Revision: https://developer.blender.org/D1630
intern/cycles/render/graph.cpp
intern/cycles/render/graph.h
intern/cycles/render/osl.cpp
intern/cycles/render/osl.h
intern/cycles/render/svm.cpp
intern/cycles/render/svm.h