(gpu.cpp) Small backports from 0.9.37-unstable