fc5c6ab374bb593ece6fe02a213fe9c1d1d953eb
We used to set shader->osl_surface_ref during shader compilation and then pushed it into the shared vectors. This worked as long as everything was serial - but after the multithreading change, we a) compile everything and then b) build the shared vectors since just pushing into them from multiple threads would not work. However, if there are multiple devices, then each shader will be compiled multiple times - so in the end, shader->osl_surface_ref etc. will be set to the last device's value. Then, we end up pushing that value into every device's vectors, which breaks for the earler devices. The fix is simple - just preallocate the vectors and pass the correct index into the compilation function. This way, each thread can safely store its result and we can get rid of shader->osl_surface_ref entirely. Note that while multiple shaders are compiled in parallel, the loop over devices for a given shader is serial, so there's no concern of conflicts over other shader internals. Pull Request: https://projects.blender.org/blender/blender/pulls/146617
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
