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