DP master heavy FPS loss after enabling netgraph
As discussed on IRC. After ones enables netgraph on darkplaces master it leads to heavy FPS loss.
I bisected it down to 4a43205a which changed how lines are being drawn.
Now DrawQ_Line
instead of being simple operation like:
qglBegin(GL_LINES);
qglVertex2f(x1, y1);
qglVertex2f(x2, y2);
qglEnd();
is complicated:
surf = Mod_Mesh_AddSurface(mod, Mod_Mesh_GetTexture(mod, "white", 0, 0, MATERIALFLAG_VERTEXCOLOR), true);
e0 = Mod_Mesh_IndexForVertex(mod, surf, x1 - offsetx, y1 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
e1 = Mod_Mesh_IndexForVertex(mod, surf, x2 - offsetx, y2 - offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
e2 = Mod_Mesh_IndexForVertex(mod, surf, x2 + offsetx, y2 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
e3 = Mod_Mesh_IndexForVertex(mod, surf, x1 + offsetx, y1 + offsety, 10, 0, 0, -1, 0, 0, 0, 0, r, g, b, alpha);
Mod_Mesh_AddTriangle(mod, surf, e0, e1, e2);
Mod_Mesh_AddTriangle(mod, surf, e0, e2, e3);
where Mod_Mesh_IndexForVertex
performs quite a lot of operations on hashtable used to keep coordinates for trangles.
Feels like it is overly complicated.