Make sure that pi3d's shader is called on the main thread.