Using ApiTrace to improve D3D/OpenGL performance