Use the lately introduced parser for that. This allows to use preprocessor directive inside them. By extension, it alows having resource accessors inside templates. Also error report is less confusing on most shader compilers. The counterpart is that the shader files that are shipped with blender are inflated. Pull Request: https://projects.blender.org/blender/blender/pulls/144588