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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-16 17:00:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-16 17:00:09 +0400
commit0a5fcf3da3e82fd114095c8c2903d927f15ffc31 (patch)
treeab7206829b29a4225c5b66e7456a9d1484a17834 /intern/cycles/render/svm.h
parent376aede7a6dbe0d5beee4dc5fd89bd8608c36b09 (diff)
Cycles: fix issue with mix shaders, leading to use of uninitialized memory.
Diffstat (limited to 'intern/cycles/render/svm.h')
-rw-r--r--intern/cycles/render/svm.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index 05fb85b057f..dfd78cf3c40 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -78,6 +78,27 @@ public:
protected:
struct Stack {
Stack() { memset(users, 0, sizeof(users)); }
+ Stack(const Stack& other) { memcpy(users, other.users, sizeof(users)); }
+ Stack& operator=(const Stack& other) { memcpy(users, other.users, sizeof(users)); return *this; }
+
+ bool empty()
+ {
+ for(int i = 0; i < SVM_STACK_SIZE; i++)
+ if(users[i])
+ return false;
+
+ return true;
+ }
+
+ void print()
+ {
+ printf("stack <");
+
+ for(int i = 0; i < SVM_STACK_SIZE; i++)
+ printf((users[i])? "*": " ");
+
+ printf(">\n");
+ }
int users[SVM_STACK_SIZE];
};