Fix sampling cube maps.

Workaround bug in Intel drivers for sampling cube maps. Fixes #1396.