Fix T51805: Overlapping volumes renders incorrect on AMD GPU

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.
This commit is contained in:
Sergey Sharybin 2017-08-23 12:32:48 +02:00
parent b9513706cb
commit 5c60721c9e
Notes: blender-bot 2023-02-14 06:53:20 +01:00
Referenced by issue #51805, Point Density with overlapping volumes doesn't work on GPU
1 changed files with 3 additions and 0 deletions

View 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;
}