Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/film.cpp7
-rw-r--r--intern/cycles/util/util_algorithm.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index d1e2ef66c2c..baf02901123 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -203,9 +203,10 @@ void Pass::add(PassType type, vector<Pass> &passes, const char *name)
passes.push_back(pass);
- /* order from by components, to ensure alignment so passes with size 4
- * come first and then passes with size 1 */
- sort(&passes[0], &passes[0] + passes.size(), compare_pass_order);
+ /* Order from by components, to ensure alignment so passes with size 4
+ * come first and then passes with size 1. Note this must use stable sort
+ * so cryptomatte passes remain in the right order. */
+ stable_sort(&passes[0], &passes[0] + passes.size(), compare_pass_order);
if (pass.divide_type != PASS_NONE)
Pass::add(pass.divide_type, passes);
diff --git a/intern/cycles/util/util_algorithm.h b/intern/cycles/util/util_algorithm.h
index 62093039625..63abd4e92a3 100644
--- a/intern/cycles/util/util_algorithm.h
+++ b/intern/cycles/util/util_algorithm.h
@@ -25,6 +25,7 @@ using std::max;
using std::min;
using std::remove;
using std::sort;
+using std::stable_sort;
using std::swap;
CCL_NAMESPACE_END