The image manager used to handle OSL textures on the GPU by default loads images after displacement is evaluated. This is a problem when the displacement shader uses any textures, hence why the geometry manager already makes the image manager load any images used in the displacement shader graph early (`GeometryManager::device_update_displacement_images`). This only handled Cycles image nodes however, not OSL nodes, so if any `texture` calls were made in OSL those would be missed and therefore crash when accessed on the GPU. Unfortunately it is not simple to determine which textures referenced by OSL are needed for displacement, so the solution for now is to simply load all of them early if true displacement is used. This patch also fixes the result of the displacement shader not being used properly in OptiX. Maniphest Tasks: T104240 Differential Revision: https://developer.blender.org/D17162
71 KiB
71 KiB