added support for reference variables in textures