opengl32: Split trace generation to separate functions.