From: cloudwalk Date: Thu, 2 Jul 2020 13:37:13 +0000 (+0000) Subject: Don't Mod_BuildTextureVectorsFromNormals if 2D. 5-10% performance improvement X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=055003a1c78341222d3909cea3413de18808a621;p=xonotic%2Fdarkplaces.git Don't Mod_BuildTextureVectorsFromNormals if 2D. 5-10% performance improvement This is likely not needed for 2D and there doesn't appear to be any defects, visual or otherwise. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12775 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_shared.c b/model_shared.c index f4f74cd9..86ab5c52 100644 --- a/model_shared.c +++ b/model_shared.c @@ -4705,6 +4705,7 @@ void Mod_Mesh_Finalize(dp_model_t *mod) Mod_Mesh_Validate(mod); Mod_Mesh_ComputeBounds(mod); Mod_Mesh_MakeSortedSurfaces(mod); - Mod_BuildTextureVectorsFromNormals(0, mod->surfmesh.num_vertices, mod->surfmesh.num_triangles, mod->surfmesh.data_vertex3f, mod->surfmesh.data_texcoordtexture2f, mod->surfmesh.data_normal3f, mod->surfmesh.data_element3i, mod->surfmesh.data_svector3f, mod->surfmesh.data_tvector3f, true); + if(!r_refdef.draw2dstage) + Mod_BuildTextureVectorsFromNormals(0, mod->surfmesh.num_vertices, mod->surfmesh.num_triangles, mod->surfmesh.data_vertex3f, mod->surfmesh.data_texcoordtexture2f, mod->surfmesh.data_normal3f, mod->surfmesh.data_element3i, mod->surfmesh.data_svector3f, mod->surfmesh.data_tvector3f, true); Mod_Mesh_UploadDynamicBuffers(mod); }