There isn't a need for passing cache to create_texture(), as this is a closure in createMaterial() context, so textureCache is available (in the same way texturePath is also available and used in this function).