Fix reftest failure on AMD GPUs. Fixes #2642 (and probably #2064).
Merge pull request #72 from glennw/issue-2642

Fix reftest failure on AMD GPUs. Fixes #2642 (and probably #2064).