]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Don't Mod_BuildTextureVectorsFromNormals if 2D. 5-10% performance improvement
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 2 Jul 2020 13:37:13 +0000 (13:37 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 2 Jul 2020 13:37:13 +0000 (13:37 +0000)
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

model_shared.c

index f4f74cd931d1f9c96af0fe7e02cedcbc5280051b..86ab5c52789a32474f0b61e52b68d6439691080d 100644 (file)
@@ -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);
 }