c++ - OpenGL program with Intel HD and NVidia GPU usage -
i new in opengl , want explain me how program uses gpu.
i have array of triangles(class contains 3 points). here code draw them( know these functions depricated).
glbegin(gl_lines); for(int i=0; i<trsize; ++i){ glvertex3d((gldouble)trarr[i].p1().x(), (gldouble)trarr[i].p1().y(), (gldouble)trarr[i].p1().z()); glvertex3d((gldouble)trarr[i].p2().x(), (gldouble)trarr[i].p2().y(), (gldouble)trarr[i].p2().z()); glvertex3d((gldouble)trarr[i].p3().x(), (gldouble)trarr[i].p3().y(), (gldouble)trarr[i].p3().z()); } glend();
and use depricated functions rotating, transforming, etc.
when size of array bigger 50k, program works slow. tried use intel hd or nvidia gtx860m (the default nvidia program allows choose gpu) both works slow. maybe intel hd works bit faster.
so, why there no difference between these 2 gpus? , program work faster using shaders?
when size of array bigger 50k, program works slow.
the major bottleneck when drawing in intermediate mode is, vertices have transferred in every frame programs memory gpu memory. bus between gpu , cpu limited in amout of data can transfer, best guess is, 50k triangles more bus can transport. problem is, driver has process commands send him on cpu, can big overhead.
so, why there no difference between these 2 gpus?
there (in general) huge performance difference between intel hd card , nvidia card, bus between them might same.
and program work faster using shaders?
it not benefit directly user of shaders, storing vertices once on gpu memory (see vbo/vao). second improvement is, can render whole vbo using 1 draw call, decreases amount of instructions cpu has handle.
Comments
Post a Comment