0dc4754da4796fc40f54bb9cc5b38f651ee807dd
On the one hand, this improves initialization time since we don't need to load/compile the full OSL module with all the shading logic if we're only using a custom camera with SVM shading. On the other hand, it also fixes a bug I noticed while preparing test scenes: The AO and Bevel nodes don't work when using custom cameras with SVM on OptiX. The issue there is that those two are handled by the SHADE_SURFACE_RAYTRACE kernel, but since that one has intersection logic, we use the OptiX-specific kernel even if OSL shading is disabled. However, with the previous unified OSL module, this would mean loading SHADE_SURFACE_RAYTRACE from kernel_osl.cu, which has `#undef __SVM__` and therefore doesn't handle them correctly. With this change, we'll use the kernels from kernel_shader_raytrace.cu in that case, which do support SVM nodes just fine. Disk usage of the new kernel_optix_osl_camera.ptx.zst file is 30KB, so this also doesn't blow up the kernel disk size (and kernel_optix_osl.ptx.zst is probably smaller by that amount now). Since it seems that we can mix modules just fine, I'm suspecting that we could split the modules properly (intersection, SVM shading with raytracing, OSL shading, OSL camera), instead of the current approach where modules essentially correspond to feature set tiers and each includes the previous one's kernels as well - but that's a separate refactor. Pull Request: https://projects.blender.org/blender/blender/pulls/138021
…
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%
