This fixes a threading issues when material shaders with textures are used. It localizes the names of the samplers.