Fix T51805: Overlapping volumes renders incorrect on AMD GPU
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 23 Aug 2017 10:32:48 +0000 (12:32 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 23 Aug 2017 10:35:23 +0000 (12:35 +0200)
We need to make sure we can store all volume closures for all objects in volume
stack. This is a bit tricky to detect what would be the "nestness" level of
volumes so for now use maximum possible stack depth. Might cause some slowdown,
but better to give reliable render output than to fail quickly.

Should be safe for 2.79 after extra eyes.

intern/cycles/render/graph.cpp

index 41e7e0205b00eae45e5209a8efa68cf6d2313c2c..08203163d1af6c4c1f4090cfe3bce399f78e57f1 100644 (file)
@@ -1018,6 +1018,9 @@ int ShaderGraph::get_num_closures()
                else if(CLOSURE_IS_PRINCIPLED(closure_type)) {
                        num_closures += 8;
                }
+               else if(CLOSURE_IS_VOLUME(closure_type)) {
+                       num_closures += VOLUME_STACK_SIZE;
+               }
                else {
                        ++num_closures;
                }