Switching viewport denoising causes kernels to be reloaded with a new feature mask, which would destroy the existing OptiX pipelines. But OSL kernels were not reloaded as well, leaving the shading pipeline uninitialized and therefore causing an error when it is later attempted to execute it. This fixes that by ensuring OSL kernels are always reloaded when the normal kernels are too.